From 214df25b9b8692e6240c27194e71327eb900b91d Mon Sep 17 00:00:00 2001 From: Stephan Linkel <251381+norganos@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:14:24 +0100 Subject: [PATCH] bugfix: wanted to use the kotlin positive-only-mod, but wrongly used rem instead of mod --- src/main/kotlin/de/linkel/aoc/Day21.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/de/linkel/aoc/Day21.kt b/src/main/kotlin/de/linkel/aoc/Day21.kt index 0d4d3ae..1e9c9ec 100644 --- a/src/main/kotlin/de/linkel/aoc/Day21.kt +++ b/src/main/kotlin/de/linkel/aoc/Day21.kt @@ -76,7 +76,7 @@ class Day21: AbstractLinesAdventDay() { if (it in area) it !in rocks else { - val p = Point(it.x.rem(area.width), it.y.rem(area.height)) + val p = Point(it.x.mod(area.width), it.y.mod(area.height)) p in area && p !in rocks } }