Page 1 of 1

fun with shuffle

Posted: Wed Aug 06, 2008 4:58 pm
by Betelgeuse
Shuffle is a boring function. What it does is shuffle around the items in a list randomly.

But one cool use is it can solve one problem that random has. Random repeats itself. So getting random names or quiz questions from a list tend to repeat themselves.

A solution to this is to make a list of those random things and use shuffle on that list then go through that list in order. That way they don't repeat.