summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2023-01-12 14:16:00 +0000
committerAdam Spragg <adam@spra.gg>2023-01-12 14:16:00 +0000
commit5073c9d007896eb822e21d49745459be22606ccc (patch)
tree3e21c0cc774f3a49eefbb977d1f38e26e3cdfd13
parent19625d5e7f22c64eca9c79c13f8eae9fbd8e3934 (diff)
Puzzle 22: Simplify because map_elem() never returns '\n'
-rw-r--r--22.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/22.c b/22.c
index df55cdb..db4ee87 100644
--- a/22.c
+++ b/22.c
@@ -187,7 +187,7 @@ elf_move(struct elf * elf, struct map const * map, int distance)
elem = map_elem(map, newelf.x, newelf.y);
// Just keep going until we wrap around to a non-blank position
- while (elem == ' ' || elem == '\n') {
+ while (elem == ' ') {
newelf.x = modulo(newelf.x + dx, map->cols);
newelf.y = modulo(newelf.y + dy, map->rows);
elem = map_elem(map, newelf.x, newelf.y);