Skip to content

Instantly share code, notes, and snippets.

@SparK-Cruz
Last active June 22, 2018 14:15
Show Gist options
  • Save SparK-Cruz/5413dbaff71931a4349213376c12f83a to your computer and use it in GitHub Desktop.
Save SparK-Cruz/5413dbaff71931a4349213376c12f83a to your computer and use it in GitHub Desktop.
Bingo random number picker
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