How do I make a shuffle function?

See the 5th link in