Unrepeated random numbers

Miscellaneous Forums/General Discussion/Unrepeated random numbers

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

denzilquixode solution is the one, all you need to do is swap.

Interestingly enough it's also the solution used in a lot of games to decide what powers ups etc to deliver to the players. It allows for wieghting of random numbers, ie. some things get delivered more often than others.

Take the following sequence "1112344444", if we shuffle it and use the new sequence to determine what powerups we deliver to the player we can always guarantee that 50% of the powerups will be of Type 4, there will always be 3 of type 1 and so on...

Anyway enough rambling, I think I must still be drunk.