mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
It looks nice, not what I expected
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import itertools
|
import itertools
|
||||||
import math
|
import math
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
@@ -69,5 +70,11 @@ class DayRunner(SeparateRunner):
|
|||||||
positions %= mod_base
|
positions %= mod_base
|
||||||
|
|
||||||
if len(numpy.unique(positions, axis=0)) == target:
|
if len(numpy.unique(positions, axis=0)) == target:
|
||||||
# TODO: print the Christmas tree, Eric prepared it for us so nicely
|
grid = [[" "] * width for _ in range(height)]
|
||||||
|
|
||||||
|
for x, y in positions:
|
||||||
|
grid[y][x] = "#"
|
||||||
|
|
||||||
|
tree = "\n".join(map((lambda x: "".join(x)), grid))
|
||||||
|
print(tree, file=sys.stderr)
|
||||||
return i
|
return i
|
||||||
|
|||||||
Reference in New Issue
Block a user