Attempt day 14 part 2
This commit is contained in:
parent
3351c1f4a7
commit
dbcf8c228f
1 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,21 @@ fun main() {
|
||||||
}
|
}
|
||||||
val part1 = topLeft * topRight * bottomLeft * bottomRight
|
val part1 = topLeft * topRight * bottomLeft * bottomRight
|
||||||
println("Part 1: $part1")
|
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
|
private const val WIDTH = 101
|
||||||
|
|
Loading…
Add table
Reference in a new issue