• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

(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