Voting system
#2

Let's say you have map[0] = 8, map[1] = 2....map[4] = 5.
I'm sure there are better ways but this should work
Код:
new index, largest;
// Loop through the whole array.
for(new i = 0; i < 4; i++)
{
	if(map[i] > largest)
	{
            // Update the index
	    index = i;
           // Update the largest value.
	    largest = map[i];
	}
}
now map[index] is the array with the largest value.
But of course you have to change "4" to the number of maps and store values in an array.
Reply


Messages In This Thread
Voting system - by kamiliuxliuxliux - 20.05.2014, 20:51
Re : Voting system - by mirou123 - 20.05.2014, 21:00
Re: Voting system - by kamiliuxliuxliux - 20.05.2014, 21:03
Re : Voting system - by mirou123 - 20.05.2014, 21:03
Re: Voting system - by kamiliuxliuxliux - 21.05.2014, 12:19

Forum Jump:


Users browsing this thread: 1 Guest(s)