function game(nameList, number) {
while (nameList.length > 1) {
for (let i = 0; i < number - 1; i++) {
nameList.push(nameList.shift());
}
nameList.shift();
}
return nameList;
}
JavaScript实现击鼓传花方法
最新推荐文章于 2022-07-31 22:22:10 发布