This commit is contained in:
Jorge 2015-03-07 23:21:35 -03:00
commit 398ac998ab

View file

@ -41,6 +41,7 @@ class Rand
# shuffle array in place, and also return it
shuffle: (arr) =>
return arr unless arr.length > 2
for i in [arr.length-1 .. 1]
j = Math.floor @randf() * (i - 1)
t = arr[j]