• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Code for Hero Tournament

Status
Not open for further replies.
Level 19
Joined
Jul 2, 2011
Messages
2,162
hey.... quick request.

can someone write me a code that will arrange a selection of heroes from weakest to strongest. here's the general idea. heroes battle it out, the weakest vs each other until 1 by one the winners of the tournaments are simple the strongest verses the other strongest.

I've tried a for loop but to be honest it's easier to create this code in java.

my request: arrange units from weakest to strongest into an unit array
 
Last edited by a moderator:
Level 19
Joined
Jul 2, 2011
Messages
2,162
I need it to start with the weakest units vs each other. the strongest needs to be reserved for last because winning a fight makes you stronger and I want the small guys to at least have a chance at getting stronger.

I've created a for loop that sort of works but it stops continuing to work after round 1.

for a 1 -8 (which is the number of units)
for b 1-8(enclosed in previous loop)
if random hero A is stronger then random hero be, then put A in group [A]

it works but it can't handle blanks. I've tried reducing the number of....

I think I have a solution... carry on working it out while I think
 
Status
Not open for further replies.
Top