var P = {
RandDigtal: function (balllen, count, allrepate) {
var arr = [];
while (arr.length < count) {
var randomNumber = (Math.floor((Math.random() * 100)) % balllen + 1);
if (randomNumber <= balllen) {
if (allrepate == 1) {
arr.push(randomNumber);
} else {//不允许重复的话
if (arr.indexOf(randomNumber) == -1) {
arr.push(randomNumber);
}
}
}
}
var compare = function (x, y) {//比较函数
if (x < y) {
return -1;
} else if (x > y) {
return 1;
} else {
return 0;
}
}
arr = arr.sort(compare);
return arr;
}
仿彩票机选神器-清零世界
最新推荐文章于 2024-10-29 14:22:44 发布