# [Trigger] How to see what three integers are highest?

Discussion in 'Triggers & Scripts' started by Airandius, May 11, 2009.

1. ### GhostWolf

Joined:
Jul 29, 2007
Messages:
4,843
Resources:
2
Tools:
1
Tutorials:
1
Resources:
2
It's not that they can't, it is that they don't even bother trying. I could figure what a small code like that does before I knew anything about programming or Jass.

I find it hard to see how this relates to the last previous posts, or to the thread at all.

2. ### onix_noob

Joined:
May 30, 2008
Messages:
433
Resources:
1
Maps:
1
Resources:
1
I find it hard to see how this relates to the last previous posts, or to the thread at all. I couldn't answer better than u already do, thanks for you help read my signature

3. ### GhostWolf

Joined:
Jul 29, 2007
Messages:
4,843
Resources:
2
Tools:
1
Tutorials:
1
Resources:
2
The first part made no sense.
And does the second part mean I have a big penis? (should I be happy or sad?)

4. ### Schuhu

Joined:
Jun 4, 2007
Messages:
6
Resources:
0
Resources:
0
Wll, we have two "only" ways now, but i will throw in a third:

• Leaderboard - Create a leaderboard for (All players) titled Hello i count.
• Set board = (Last created leaderboard)
• -------- IntegerVar[A] is the integer variable you have connected to each player --------
• For each (Integer A) from 1 to 8, do (Actions)
• Loop-Actions
• Leaderboard - Change the value for (Player((Integer A))) in (Last created leaderboard) to Integer[(Integer A)]
• Leaderboard - Sort board by Value in decending order
• Set TempPlayer = (Player in position 1 of board)
• Set High = Integer[(Player number of TempPlayer)]
• Bestenliste - Destroy board

I don't know if the hide board is needed
Now, in TempPlayer you have the leading player and High is his value.

Last edited: May 12, 2009

Joined:
Mar 31, 2009
Messages:
709
Resources:
1
Maps:
1
Resources:
1

6. ### Lord_BoNes

Joined:
Sep 5, 2007
Messages:
264
Resources:
0
Resources:
0
Did we all forget that the leaderboard can sort itself? LOL

7. ### Schuhu

Joined:
Jun 4, 2007
Messages:
6
Resources:
0
Resources:
0
Hell, whats the english version of this one:
• Leaderboard - Sort board by Value in Absteigend order

I have no idea, lol.

8. ### Lord_BoNes

Joined:
Sep 5, 2007
Messages:
264
Resources:
0
Resources:
0
I take it that it means decending order (from highest to lowest).

9. ### Schuhu

Joined:
Jun 4, 2007
Messages:
6
Resources:
0
Resources:
0
Sounds good, i edited it.

10. ### Teelo

Joined:
Mar 31, 2009
Messages:
709
Resources:
1
Maps:
1
Resources:
1
It works, but doing a mergesort O(nlogn) and then a binary search O(logn) is definitely less efficient than my method, doing a sequential search O(n).

11. ### Airandius

Joined:
Jun 12, 2007
Messages:
1,238
Resources:
3
Icons:
1
Maps:
1
Tutorials:
1
Resources:
3
People, the problem is already solved, stop spamming.