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.
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.