1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  4. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  5. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

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

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

  1. GhostWolf

    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

    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

    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

    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)
    • Leaderboard - Hide board
    • -------- 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 :slp:
    Now, in TempPlayer you have the leading player and High is his value.
     
    Last edited: May 12, 2009
  5. Teelo

    Teelo

    Joined:
    Mar 31, 2009
    Messages:
    709
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Lol. Leaderboard. Good one ^^
     
  6. Lord_BoNes

    Lord_BoNes

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

    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

    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

    Schuhu

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

    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

    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.
    And leader boards suck.

    /no replies