Karawasa Posted August 1, 2007 I was able to quickly create the randomization in Chaos mode, thanks to Intro CS. We learned Java in the class, and one assignment required us to randomize a list. Here is the code, I'm sure you can see what I am talking about: For each (Integer A) from 0 to 59, do (Actions) Loop - Actions Set Random_Spawn = (Random integer number between 0 and 59) Set Temp_Spawn = Spawns[(Integer A)] Set Spawns[(Integer A)] = Spawns[Random_Spawn] Set Spawns[Random_Spawn] = Temp_Spawn Go to top Share this post Link to post
Guest mrchak Posted August 1, 2007 You could probably even do For each (Integer A) from 0 to 58, do (Actions) ...Set Random_Spawn = (Random integer number between Integer A and 59)... which will go through every one and swap it with a random round that comes after it (or itself). Once it gets to 58, it doesn't need to do 59, because its already been swapped most likely. And if you want to ENSURE no round ends up being itself, then you could say: For each (Integer A) from 0 to 58, do (Actions) ...Set Random_Spawn = (Random integer number between Integer A+1 and 59)... Go to top Share this post Link to post
echinodermata Posted August 3, 2007 I can't help but think this can be done better. Go to top Share this post Link to post
Guest Sancdar Posted August 3, 2007 Uh...what do you suggest? Chak's is the standard prand initialization. Go to top Share this post Link to post