Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 267: | Line 267: | ||
while(counter--) | while(counter--) | ||
{ | { | ||
- | index= (Math.random() * counter) | + | index= Math.floor(Math.random() * counter); |
temp= array[counter]; | temp= array[counter]; | ||
array[counter]= array[index]; | array[counter]= array[index]; | ||
Line 281: | Line 281: | ||
for(var i= 0 ; i < simulations[simid].reactions.length ; ++i) | for(var i= 0 ; i < simulations[simid].reactions.length ; ++i) | ||
indexes[i]= i; | indexes[i]= i; | ||
- | + | shuffle_array(indexes); | |
alert(indexes[0]); | alert(indexes[0]); | ||
} | } |
Revision as of 23:16, 2 August 2013