Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always same result #64

Open
PeterMG1 opened this issue May 5, 2019 · 0 comments
Open

Always same result #64

PeterMG1 opened this issue May 5, 2019 · 0 comments

Comments

@PeterMG1
Copy link

PeterMG1 commented May 5, 2019

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:

`<script>

	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>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant