|
|

楼主 |
发表于 2022-7-2 10:53
|
显示全部楼层
<p class="bbbox"></p>
<script>
let bbbox = document.querySelector('.bbbox');
let bonus = [100,900,188,2000,20,600];
let total = bonus.length;
let num = (min,max) => Math.floor(Math.random()*(max-min+1))+min;
arDel();
console.log(bonus);
function arDel() {
let idx = num(0,bonus.length - 1);
let money = bonus[idx];
bonus.splice(idx, 1);
bbbox.innerHTML += total - bonus.length + ' 号奖金 : ' + money + '<br>';
if(bonus.length == 0) {
bbbox.innerHTML += '<br>奖金池已清空。敬请期待下一期...';
return false;
}
setTimeout(() => arDel(), 1000);
}
</script>
|
评分
-
| 参与人数 1 | 威望 +30 |
金钱 +60 |
经验 +30 |
收起
理由
|
加林森
| + 30 |
+ 60 |
+ 30 |
很给力! |
查看全部评分
|