Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
- let win = 0;
- let trails = 10000000;
- for (let i = 0; i < trails; i++) {
- if (arr[Math.floor(Math.random() * arr.length)] === '0') {
- win += 50;
- }
- if (arr[Math.floor(Math.random() * arr.length)] === '0') {
- win += 30;
- }
- for (let k = 0; k < 8; k++) {
- if (arr[Math.floor(Math.random() * arr.length)] === '0') {
- win += 10;
- }
- }
- }
- console.log(win / trails);
Advertisement
Add Comment
Please, Sign In to add comment