diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-25 00:29:25 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 0d12dd09e1263ac4384a30926d57678a6eb9fc48 (patch) | |
| tree | 6238147e851a99c153798c276b04ff7e720d90ee /include | |
| parent | a32bc9866512886eb56dcdd1197026e8512a4565 (diff) | |
I don't understand why action_list.c:306 != 259
Diffstat (limited to 'include')
| -rw-r--r-- | include/action_list.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/action_list.c b/include/action_list.c index 66435dc..9e987bc 100644 --- a/include/action_list.c +++ b/include/action_list.c @@ -183,7 +183,7 @@ void action_take(action_list_t *action) { // Use the Kernighan method to count the set bits for (steps = 1; gaps_prime; steps++) gaps_prime &= gaps_prime - 1; // then from the destination to the source - for (uint8_t d = 0; d + 1 <= num; d++) { + for (uint8_t d = 0; d < num; d++) { // transfer the top colour colours[loc+steps*delta] <<= 1; colours[loc+steps*delta] |= colours[loc] & 1; @@ -256,7 +256,7 @@ void action_undo(action_list_t *action) { uint8_t steps = 1, mask = 1; if (num > 1) { - for (uint8_t d = 0; d + 1 <= num; d++) { + for (uint8_t d = 0; d < num; d++) { colours[loc] <<= 1; colours[loc] |= colours[loc+steps*delta] & 1; colours[loc+steps*delta] >>= 1; @@ -303,7 +303,7 @@ void action_to_ptn(action_list_t* action, char* out_ptn) { uint8_t mask = 1, steps = 0; // Translate to a drop sequence drops[0] = 1; mask = 1; - for (uint8_t d = 0; d + 1 < num; d++) { + for (uint8_t d = 1; d < num; d++) { if (gaps & mask) { steps++; drops[steps] = 1; // (*) no bounds check |
