JavaScript 为小游戏项目添加图片(游戏)
2020-12-12 21:07
标签:height null http rgba learn school set order containe
var images = ["https://www.w3cschool.cn/statics/codecamp/images/9H17QFk.png", "https://www.w3cschool.cn/statics/codecamp/images/9RmpXTy.png", "https://www.w3cschool.cn/statics/codecamp/images/VJnmtt5.png"];
slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
// Only change code below this line.
$($(‘.slot‘)[0]).html(‘‘);
$($(‘.slot‘)[1]).html(‘‘);
$($(‘.slot‘)[2]).html(‘‘);
// Only change code above this line.
if (slotOne === slotTwo && slotTwo === slotThree) {
$(‘.logger‘).html("It‘s A Win");
return null;
}
if (slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
$(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
}
$(‘.logger‘).append(" Not A Win");
return [slotOne, slotTwo, slotThree];
}
$(document).ready(function() {
$(‘.go‘).click(function() {
runSlots();
});
});
FCC Slot Machine
JavaScript 为小游戏项目添加图片(游戏)
标签:height null http rgba learn school set order containe
原文地址:https://www.cnblogs.com/chendi618/p/11000720.html
上一篇:一、数组---存在重复元素
下一篇:python_集合
文章标题:JavaScript 为小游戏项目添加图片(游戏)
文章链接:http://soscw.com/index.php/essay/23657.html