• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

(Solved!) Trigger that sorts numbers. GUI

Status
Not open for further replies.

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Hello and thank you for reading my thread!
I am making a trigger that displays damage dealt by players 1-8 starting with the player that has dealt the highest damage and ending with the player that dealt the lowest damage.

int1[] = Integer variable with array that holds random numbers in array 1-8. The goal is to sort this integer variable into holding the highest number in int1[1] and the lowest number in int1[8]

Then I can do:
For each integer loop 1-8 do actions:
Display int1(integer loop)


My question is:
- How do I sort int1[] into int[1]>int[2]>int[3]>int[4]>int[5]>int[6]>int[7]>int[8] ?

Hints:
- The numbers that the system will sort (that int1[] holds) will range from 0-100 000.
- I am looking for readability>memory usage (I'm not great with code, I don't know Vjass or JASS.)
- I am very greatful for GUI answers.

To summarize:
1) Put random numbers into int[1], int[2], int[3], int[4], int[5], int[6], int[7], int[8] (damage dealt by players.)
2) Run the trigger.
3) Now the trigger has sorted the numbers into int[1]>int[2]>int[3]>int[4]>int[5]>int[6]>int[7]>int[8]

+4 rep to anyone helping me solve this!
Thank you for reading. Here is a picture of a kitten for extra request power!
2bxAxre.jpg
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@pOke Thanks! I had a look into it but I couldn't seem to figure it out.
@Wareditor Sorry about the cheesy title, I'll keep it in mind for future threads! I remember the system you made me for now, I had it already prepared for this phase of the development - a miss from me, sorry.

I contacted Hagge5 and he managed to help me through the hazzle of creating this. Thanks for your shared interest <3 Thread closed.
 
Last edited:
Status
Not open for further replies.
Top