Skip to content

Instantly share code, notes, and snippets.

@lucasprogamer
Last active December 27, 2023 18:31
Show Gist options
  • Save lucasprogamer/14b32e642970d8cfaa4f2e833cb020f0 to your computer and use it in GitHub Desktop.
Save lucasprogamer/14b32e642970d8cfaa4f2e833cb020f0 to your computer and use it in GitHub Desktop.
function numerosMegaVirada() {
const min = 1;
const max = 60;
const max_numbers = 6;
let numbers = [];
do {
let number = Math.random() * (max - min) + min;
if (number >= min && number <= max && !numbers.includes(parseInt(number))) numbers.push(parseInt(number));
} while (numbers.length != max_numbers);
return numbers;
}
numerosMegaVirada();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment