2011.01.21 | mucho
たまに使うのでメモ。
private function ArrayShuffle(arr:Array){ var l = arr.length; var newArr = arr; while(l){ var m = int(Math.random()*l); var n = newArr[--l]; newArr[l] = newArr[m]; newArr[m] = n; } return newArr; }
たまに使うのでメモ。
private function ArrayShuffle(arr:Array){ var l = arr.length; var newArr = arr; while(l){ var m = int(Math.random()*l); var n = newArr[--l]; newArr[l] = newArr[m]; newArr[m] = n; } return newArr; }