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.