javascriptはstringのランダムな文字を返します.
474 ワード
for (i = 0; i < pattern.length; i++){
array[i] = pattern[i].toLowerCase();
}
//array = ['2','f','3','r']
var b = [];
var randomArray = function(a,b) {
if (a.length > 0){
b.push(a.splice(Math.floor(Math.random() * a.length)-1, 1)[0]);
randomArray(a,b);
}
}
randomArray(array, b);
//b= array