generated from public/aoc_template
day14 - cleanup typing annotations
This commit is contained in:
parent
c353f58280
commit
fb45c9440d
9
day14.py
9
day14.py
@ -3,6 +3,9 @@ from tools.tools import compare
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
|
type Robot = tuple[tuple[int, int], tuple[int, int]]
|
||||||
|
|
||||||
|
|
||||||
class Day(AOCDay):
|
class Day(AOCDay):
|
||||||
inputs = [
|
inputs = [
|
||||||
[
|
[
|
||||||
@ -14,7 +17,7 @@ class Day(AOCDay):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
def parse_input(self) -> list[tuple[tuple[int, int], tuple[int, int]]]:
|
def parse_input(self) -> list[Robot]:
|
||||||
robots = []
|
robots = []
|
||||||
for line in self.getInput():
|
for line in self.getInput():
|
||||||
p, v = line.split()
|
p, v = line.split()
|
||||||
@ -24,9 +27,7 @@ class Day(AOCDay):
|
|||||||
|
|
||||||
return robots
|
return robots
|
||||||
|
|
||||||
def move_robots(
|
def move_robots(self, robots: list[Robot], steps: int = 100) -> tuple[tuple[int, int], list[Robot]]:
|
||||||
self, robots: list[tuple[tuple[int, int], tuple[int, int]]], steps: int = 100
|
|
||||||
) -> tuple[tuple[int, int], list[tuple[tuple[int, int], tuple[int, int]]]]:
|
|
||||||
if self.is_test():
|
if self.is_test():
|
||||||
dim = (11, 7)
|
dim = (11, 7)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user