utilize aoc_ocr
This commit is contained in:
parent
27cdaafef7
commit
f63a3623d4
10
day08.py
10
day08.py
@ -1,4 +1,5 @@
|
||||
from tools.aoc import AOCDay
|
||||
from tools.aoc_ocr import convert_6
|
||||
from typing import Any
|
||||
|
||||
|
||||
@ -8,7 +9,7 @@ class Day(AOCDay):
|
||||
(2806, "input08")
|
||||
],
|
||||
[
|
||||
("see image above", "input08")
|
||||
("ZBJAB", "input08")
|
||||
]
|
||||
]
|
||||
|
||||
@ -57,14 +58,11 @@ class Day(AOCDay):
|
||||
while layers[z][y][x] == "2":
|
||||
z += 1
|
||||
|
||||
line += " " if layers[z][y][x] == "0" else "#"
|
||||
line += "." if layers[z][y][x] == "0" else "#"
|
||||
|
||||
rows.append(line)
|
||||
|
||||
for x in rows:
|
||||
print(x)
|
||||
|
||||
return "see image above"
|
||||
return convert_6("\n".join(rows))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
8
day11.py
8
day11.py
@ -1,7 +1,7 @@
|
||||
from intcode import IntCode
|
||||
from tools.aoc import AOCDay
|
||||
from tools.coordinate import Coordinate
|
||||
from tools.grid import Grid, GridTransformation
|
||||
from tools.grid import Grid
|
||||
from typing import Any
|
||||
|
||||
MOVEMENTS = [Coordinate(0, -1), Coordinate(1, 0), Coordinate(0, 1), Coordinate(-1, 0)]
|
||||
@ -13,7 +13,7 @@ class Day(AOCDay):
|
||||
(2373, "input11")
|
||||
],
|
||||
[
|
||||
("see image above", "input11")
|
||||
("PCKRLPUK", "input11")
|
||||
]
|
||||
]
|
||||
|
||||
@ -50,9 +50,7 @@ class Day(AOCDay):
|
||||
face += 1 if comp.getOutput() else -1
|
||||
pos = pos + MOVEMENTS[face % 4]
|
||||
|
||||
hull.print(true_char='#', false_char=' ')
|
||||
|
||||
return "see image above"
|
||||
return hull.get_aoc_ocr_string(x_shift=1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Loading…
Reference in New Issue
Block a user