Randomizing arrays
To randomize an array in javascript there is this way:
a = [1,2,3,4,5]
a.sort(function() {return .5 - Math.random()});
In Python you can you shuffle from the random module
from random import shuffle a = [1,2,3,4,5] shuffle(a)
To randomize an array in javascript there is this way:
a = [1,2,3,4,5]
a.sort(function() {return .5 - Math.random()});
In Python you can you shuffle from the random module
from random import shuffle a = [1,2,3,4,5] shuffle(a)
Create a website and earn with Altervista - Disclaimer - Report Abuse - Privacy Policy - Manage tracking preferences