Skip to content

Commit 98983f6

Browse files
committed
It looks nice, not what I expected
1 parent 4a7305d commit 98983f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

2024/src/aoc/days/day14.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import itertools
22
import math
33
import re
4+
import sys
45

56
import numpy
67

@@ -69,5 +70,11 @@ def part2(cls, input: str) -> int:
6970
positions %= mod_base
7071

7172
if len(numpy.unique(positions, axis=0)) == target:
72-
# TODO: print the Christmas tree, Eric prepared it for us so nicely
73+
grid = [[" "] * width for _ in range(height)]
74+
75+
for x, y in positions:
76+
grid[y][x] = "#"
77+
78+
tree = "\n".join(map((lambda x: "".join(x)), grid))
79+
print(tree, file=sys.stderr)
7380
return i

0 commit comments

Comments
 (0)