Skip to content

Instantly share code, notes, and snippets.

@binarytemple
Created July 1, 2012 11:30
Show Gist options
  • Save binarytemple/3028050 to your computer and use it in GitHub Desktop.
Save binarytemple/3028050 to your computer and use it in GitHub Desktop.
test
scala> val l = List("cat","dog","frog")
l: List[java.lang.String] = List(cat, dog, frog)
scala> Random.shuffle(l)
res8: List[java.lang.String] = List(frog, dog, cat)
scala> Random.shuffle(l).take(2)
res10: List[java.lang.String] = List(dog, frog)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment