From dbcf8c228fe58c761c32a27b446bdf67a9aed410 Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Sun, 15 Dec 2024 11:26:12 +0100 Subject: [PATCH] Attempt day 14 part 2 --- 2024/src/main/kotlin/day14.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/2024/src/main/kotlin/day14.kt b/2024/src/main/kotlin/day14.kt index 2eaefb6..bd448f2 100644 --- a/2024/src/main/kotlin/day14.kt +++ b/2024/src/main/kotlin/day14.kt @@ -36,6 +36,21 @@ fun main() { } val part1 = topLeft * topRight * bottomLeft * bottomRight println("Part 1: $part1") + + var time = 0 + while (time < 100) { + val grid = CharGrid(WIDTH, HEIGHT, '.') + for (robot in initial) { + val pos = robot.move(time).position + grid[pos] = '#' + } + + println("t = $time") + println(grid.rows.joinToString(separator = "\n")); + println() + + ++time + } } private const val WIDTH = 101