pointArray = new Array();
tempArray = new Array();
num = 30;
for (var i = 0; i<num; i++) {
pointArray.push(i);
}
function getRan(ran) {
return pointArray[ran];
}
function saveData() {
for (var i = 0; i<10; i++) {
len = pointArray.length-1;
n = int(Math.random()*len);
tempArray.push(getRan(n));
pointArray.splice(n,1)
}
}
saveData();
tempArray = new Array();
num = 30;
for (var i = 0; i<num; i++) {
pointArray.push(i);
}
function getRan(ran) {
return pointArray[ran];
}
function saveData() {
for (var i = 0; i<10; i++) {
len = pointArray.length-1;
n = int(Math.random()*len);
tempArray.push(getRan(n));
pointArray.splice(n,1)
}
}
saveData();
回复Comments
作者:
{commentrecontent}