- Joined
- Jul 25, 2009
- Messages
- 3,091
Uhm.. that just seems very bulky. All i want is a function that i can call, where i give "who has x most docks?" where x can be 1st, 3rd, and so on, and i return a player.
This is how you get the player with most docks, that is pretty simple:
you make a loop that exits when index > number of allies. then you have two variables, one integer called "max" and one player called "p". you start by settyng "p" as ally number 1 (the one with the lowest player number, like player 1, if he is an ally) and "max" as the number of ports i have (which i have stored in an array variable called NumPorts[]). every loop, you increase index by 1 and check if NumPorts > max. If it is, i set max to NumPorts, and p to Player(i). When the loop finishes i will recieve the top player.
Now, i just want this code to stack them by order in an array p[], so that i can return the position i want.
By the way, you can except to see the Portland-class Cruiser up soon!!
Well, pfft, I would have just used a the simpleton way. xD
When's the next beta test?