Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,239
So, I am in need of shuffling an array of numbers.
loop 1-max
temp = array;
rng = random between i-max
array = array[rng]
array[rng] = temp
Somehow this does not seem like a 'shuffle' to me.
Not to mention at the end, theoretically, nothing has changed. ( sure the chance of that happening is small but you get my point x) )
I could work around this issue with extra code, but I feel like it's getting more complex than it should at that point.
loop 1-max
temp = array;
rng = random between i-max
array = array[rng]
array[rng] = temp
Somehow this does not seem like a 'shuffle' to me.
Not to mention at the end, theoretically, nothing has changed. ( sure the chance of that happening is small but you get my point x) )
I could work around this issue with extra code, but I feel like it's getting more complex than it should at that point.