Skip to content

Instantly share code, notes, and snippets.

@pedroglcbarros
Last active October 6, 2021 18:15
Show Gist options
  • Select an option

  • Save pedroglcbarros/0033ea77855ad28fdf542526520bfc1a to your computer and use it in GitHub Desktop.

Select an option

Save pedroglcbarros/0033ea77855ad28fdf542526520bfc1a to your computer and use it in GitHub Desktop.
Function to generate random numbers for a bingo game
const nums = [];
function bingo() {
let draw = Math.ceil(Math.random() * 75);
nums.includes(draw) ? bingo() : nums.push(draw);
return nums;
}
for(let i = 1; i <= 75; i++) {
bingo();
}
console.log(nums);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment