Skip to content

Commit

Permalink
Modulo division performed in shuffle_deck once per card
Browse files Browse the repository at this point in the history
  • Loading branch information
voloved committed Sep 8, 2024
1 parent f74419d commit d72e167
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion movement/watch_faces/complication/higher_lower_game_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void shuffle_deck(uint8_t *array, uint8_t n) {
// Randomize shuffle with Fisher Yates
uint8_t i, j, tmp;
for (i = n - 1; i > 0; i--) {
j = generate_random_number(0xFF) % (i + 1);
j = generate_random_number(i + 1);
tmp = array[j];
array[j] = array[i];
array[i] = tmp;
Expand Down

0 comments on commit d72e167

Please sign in to comment.