jQuery-SlotMachine
jQuery-SlotMachine copied to clipboard
Always same result
Hello, I have some problem which I cannot solve by my own. the problem is that I have always same result, no randomize at all. here is the code:
`
let count = 0;
const btnShuffle = document.querySelector('#randomizeButton');
const btnStop = document.querySelector('#casinoStop');
const casino1 = document.querySelector('#machine1');
const casino2 = document.querySelector('#machine2');
const casino3 = document.querySelector('#machine3');
const mCasino1 = new SlotMachine(casino1, {
active: 0,
delay: 500
});
const mCasino2 = new SlotMachine(casino2, {
active: 1,
delay: 500
});
const mCasino3 = new SlotMachine(casino3, {
active: 2,
delay: 500
});
btnShuffle.addEventListener('click', () => {
count = 3;
mCasino1.shuffle(9999);
mCasino2.shuffle(9999);
mCasino3.shuffle(9999);
});
btnStop.addEventListener('click', () => {
switch(count) {
case 3:
mCasino1.stop();
break;
case 2:
mCasino2.stop();
break;
case 1:
mCasino3.stop();
break;
}
count--;
});
</script>`