day23 - updated from_str interface
This commit is contained in:
parent
a82057d89c
commit
6537628779
4
day23.py
4
day23.py
@ -61,7 +61,7 @@ class Day(AOCDay):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def part1(self) -> Any:
|
def part1(self) -> Any:
|
||||||
map = Grid.from_str("/".join(self.getInput()), true_char='#')
|
map = Grid.from_str("/".join(self.getInput()), translate={'#': True, '.': False})
|
||||||
|
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
if not move_elfs(map, i):
|
if not move_elfs(map, i):
|
||||||
@ -71,7 +71,7 @@ class Day(AOCDay):
|
|||||||
return (map.maxX - map.minX + 1) * (map.maxY - map.minY + 1) - map.getOnCount()
|
return (map.maxX - map.minX + 1) * (map.maxY - map.minY + 1) - map.getOnCount()
|
||||||
|
|
||||||
def part2(self) -> Any:
|
def part2(self) -> Any:
|
||||||
map = Grid.from_str("/".join(self.getInput()), true_char='#')
|
map = Grid.from_str("/".join(self.getInput()), translate={'#': True, '.': False})
|
||||||
round = 0
|
round = 0
|
||||||
|
|
||||||
while move_elfs(map, round):
|
while move_elfs(map, round):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user