Last active
June 22, 2018 14:15
-
-
Save SparK-Cruz/5413dbaff71931a4349213376c12f83a to your computer and use it in GitHub Desktop.
Bingo random number picker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Bingo = (function(){ | |
const pool = []; | |
for(let i=0; i<79; i++) { | |
pool.push(i+1); | |
} | |
function next() { | |
const index = Math.round(Math.random() * (pool.length - 1)); | |
return pool.splice(index, 1)[0]; | |
} | |
return { | |
next: next | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment