From 5073c9d007896eb822e21d49745459be22606ccc Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 12 Jan 2023 14:16:00 +0000 Subject: Puzzle 22: Simplify because map_elem() never returns '\n' --- 22.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.1