Random numbers from 1-X without repeating

reddotincreddotinc Member Posts: 653
edited November -1 in Working with GS (Mac)
Hi guys,

I'm looking at ways to increase the performance of my game (move instead of spawn) and am looking for a way to calculate a random number from say 1 - 10 and go through that sequence without duplicating a number until all numbers have been used, and then starting the sequence again (so that duplicate actors aren't created)

Any help would be great :)

Thanks

// Red Dot Inc

Comments

  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Maybe create a boolean for each number(if it's really only 10). Create a rule that says run the random generator if any numbers are false. Set the value to true when the number is chosen the first time. Another rule that resets all to false if all are true.

    Worked on Memorcise - available on the iTunes store... ha! kidding.
  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Also you need to tell the random generator to repeat if the number chosen is already true.
Sign In or Register to comment.