function sleepfox() {
let list = [];
while (list.length < 7) {
let number = Math.ceil(Math.random() * (list.length != 7 ? 33 : 16));
if (!list.includes(number)) { // 生成的随机数不能重复
list.push(number)
}
}
let red = list.slice(0, 6).sort((a, b) => a - b); // 红色
let blue = list.slice(6, 7); // 蓝色
return [...red, ...blue]
}
网友评论