Random Shuffle
So, I’m sure that if you are familiar with C++, you are probably also familiar with the random_shuffle that can be used with vectors and stuff.
So, where is random_shuffle used anyway? Here are some examples of its possible use:
1) It can be used when you need one particular element of a vector (etc). One can random_shuffle the vector and then pick the first element of this shuffled array.
2) In Card games! It is one of the easiest ways to actually shuffle a deck of cards or anything else for that matter. Even to change the order of the enemies a player will come across at a certain game level.
It basically allows the randomization and change, making the program more interesting specially if its a game… it adds a certain level of uncertainty and thus, surprise.

yay! i feel educated! or maybe not lol
[...] more: Random Shuffle Comments [0]Digg [...]
Random Shuffle | VishwaTech IT News said this on June 17, 2009 at 8:18 am |
Basically use it whenever you need a random order, the possibilities are endless. I’ve used it in GAs, ANNs and even an ACM ICPC problem.