Skip to content

Commit

Permalink
Sort combinations and properly clear when pressing ESC
Browse files Browse the repository at this point in the history
  • Loading branch information
SavageCore committed Sep 20, 2023
1 parent 7cd623a commit 3936f68
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/App/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
if (keyPressed === 'Escape') {
pressedNumbers.update(numbers => []);
combinations = [];
currentCombination = 0;
}
});
Expand Down Expand Up @@ -88,6 +90,11 @@
}
}
// Sort combinations
combinations.sort((a, b) => {
return a[0] - b[0] || a[1] - b[1] || a[2] - b[2] || a[3] - b[3];
});
return combinations;
}
</script>
Expand Down

0 comments on commit 3936f68

Please sign in to comment.