//arr:Array n:Array's length
function disorder(arr:Array,n:Number) {
var i = 0;
var temp;
while (i<n) {
var rnd = Math.floor(Math.random()*n);
temp = arr[i];
arr[i] = arr[rnd];
arr[rnd] = temp;
i++;
}
delete temp,i;
return arr
}
//str:String s:String:that's you want to replace
function replace(str:String,s:String){
var temp=str.split(s);
str=temp.join("");
delete temp;
return str;
}
function disorder(arr:Array,n:Number) {
var i = 0;
var temp;
while (i<n) {
var rnd = Math.floor(Math.random()*n);
temp = arr[i];
arr[i] = arr[rnd];
arr[rnd] = temp;
i++;
}
delete temp,i;
return arr
}
//str:String s:String:that's you want to replace
function replace(str:String,s:String){
var temp=str.split(s);
str=temp.join("");
delete temp;
return str;
}
回复Comments
作者:
{commentrecontent}