randomize

How to shuffle (randomize) a list in Scala

As a quick note today, to shuffle/randomize a list in Scala, use this technique:

scala.util.Random.shuffle(List(1,2,3,4))

Here’s what this approach looks like in the Scala REPL: