Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 264: | Line 264: | ||
function shuffle_array(array) | function shuffle_array(array) | ||
{ | { | ||
- | var | + | for (var i = array.length - 1; i > 0; i--) |
- | + | ||
{ | { | ||
- | + | var j = Math.floor(Math.random() * (i + 1)); | |
- | temp= array[ | + | var temp = array[i]; |
- | array[ | + | array[i] = array[j]; |
- | array[ | + | array[j] = temp; |
} | } | ||
return array; | return array; |
Revision as of 23:20, 2 August 2013