Isn't the source of object scala.util.Random from 2.8.0 good enough?
// Backported to collections < 2.8.0
def shuffle[T](seq: Seq[T]): Seq[T] = {
val buf: Array[T] = seq.toArray
def swap(i1: Int, i2: Int) {
val tmp = buf(i1)
buf(i1) = buf(i2)
buf(i2) = tmp
}
for (n <- buf.length to 2 by -1) {
val k = nextInt(n)
swap(n - 1, k)
}
buf.toSeq
}
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin