[HELP]Mysql : Getting the top player.
#7

pawn Код:
stock quickSort(array[], index[], tempvar, tempsize, desc)
{
     new pivot, temp, var, i;
     if(tempvar < tempsize)
     {
        pivot = tempvar;
        var = array[pivot];
        for(i = tempvar + 1; i <= tempsize; i ++)
        {
            if(desc ? (array[i] > var) : (array[i] < var))
            {
                pivot ++;
                temp = array[i];
                array[i] = array[pivot];
                array[pivot] = temp;
                temp = index[i];
                index[i] = index[pivot];
                index[pivot] = temp;
            }
        }
        temp = array[tempvar];
        array[tempvar] = array[pivot];
        array[pivot] = temp;
        temp = index[tempvar];
        index[tempvar] = index[pivot];
        index[pivot] = temp;
        quickSort(array, index, tempvar, pivot - 1, desc);
        quickSort(array, index, pivot + 1, tempsize, desc);
     }
}
Example of usage:
pawn Код:
quickSort(aScoreInfo[eScoreInfo], aScoreInfo[score], 0, countex, true);
Reply


Messages In This Thread
[HELP]Mysql : Getting the top player. - by MrViolence101 - 09.12.2014, 23:26
Re: [HELP]Mysql : Getting the top player. - by BlackWolf120 - 09.12.2014, 23:44
Re: [HELP]Mysql : Getting the top player. - by MrViolence101 - 09.12.2014, 23:52
Re: [HELP]Mysql : Getting the top player. - by MrViolence101 - 09.12.2014, 23:54
Re: [HELP]Mysql : Getting the top player. - by BlackWolf120 - 09.12.2014, 23:57
Re: [HELP]Mysql : Getting the top player. - by BlackWolf120 - 10.12.2014, 00:02
Re: [HELP]Mysql : Getting the top player. - by SickAttack - 10.12.2014, 00:43

Forum Jump:


Users browsing this thread: 1 Guest(s)