Permutation

Status
Not open for further replies.
Level 7
Joined
Jan 7, 2016
Messages
21
Hello all,

Fairly new to making triggers work smoothly. Right now I'm working on a map that basically forces the AI the play the entirety of the game while users make some micro transactions. But what I really need help with is making Permutations.

I am stuck in my own logic of making a loop that is, by my reasoning, infinitely long.

The permutation will be used in addressing which color a certain unit is assigned. 1-4/8 different colors

Any help on the subject would be appreciated.
 
  • Set n = 6
  • Set result = n
  • For each (Integer loop_var) from 1 to (n - 1), do (Actions)
    • Loop - Actions
      • Set result = (result x loop_var)
  • -- use the result of the permutation here
all variables are integers. 'n' is the number you want to permute, result obviously has the result in it.
 
Status
Not open for further replies.
Back
Top