JavaScript 为小游戏项目添加图片(游戏)

2020-12-12 21:07

阅读:634

标签: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();
});
});





‘learn

FCC Slot Machine

























JavaScript 为小游戏项目添加图片(游戏)

标签:height   null   http   rgba   learn   school   set   order   containe   

原文地址:https://www.cnblogs.com/chendi618/p/11000720.html


评论


亲,登录后才可以留言!