Skip to content

Commit

Permalink
Sorted lottery results
Browse files Browse the repository at this point in the history
  • Loading branch information
urigrupel committed Jun 18, 2024
1 parent 7e18816 commit 2d0ad2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion script-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ function getAdvice() {
advice.classList.remove('hidden');
}

function compareNums(a, b) {
return a - b;
}

function getNumbers() {
let options = range(1, 37);
let strongOptions = range(1, 7);
Expand All @@ -33,6 +37,7 @@ function getNumbers() {
strongOptions.splice(index, 1);
}
}
choice.sort(compareNums);
const index = randInt(0, strongOptions.length);
const strong = strongOptions.splice(index, 1)[0];

Expand Down

0 comments on commit 2d0ad2c

Please sign in to comment.