| 12-27-2003, 02:45 AM | #1 |
I am making a dialog to be able to let a player choose from one of the 11 players to be a king. I know how to make the dialog and how to have the variables count the votes, but the problem I am having is getting it to compare the votes that I have gotten to choose the king. Sorry to ask a simple question, but how do I compare the results so that a player with the most votes, and no less then 3 votes, becomes the king? Thanks in advance! |
| 12-27-2003, 03:01 AM | #2 |
I'm assuming youre using some sort of array for the player's votes. Introduce a varaible called KingPlayer to store a player value. Code:
For loop 1-#ofplayers
loop: if:
vote[for loop integer A]=>3 AND if vote[for loop integer A]>vote[player number of KingPlayer]
then:
Set KingPlayer=player(convert player index For loop interger A)
else:
do nothing |
| 12-27-2003, 04:04 AM | #3 |
Thank you very much, that was exactly what I needed. |
