Formatting

This commit is contained in:
IamTheFij 2023-12-02 14:14:37 -08:00
parent 548a009d30
commit 5229f3fb54

View File

@ -1,5 +1,4 @@
from pathlib import Path from pathlib import Path
from dataclasses import dataclass
from typing import TypedDict from typing import TypedDict
@ -18,13 +17,14 @@ def grab_in_bag(bag: Grab, grab: Grab) -> bool:
class Game: class Game:
def __init__(self, id: int, grabs: list[Grab]|None = None)-> None: def __init__(self, id: int, grabs: list[Grab] | None = None) -> None:
self.id = id self.id = id
self.grabs = grabs if grabs else [] self.grabs = grabs if grabs else []
def possible(self, bag: Grab) -> bool: def possible(self, bag: Grab) -> bool:
return all(grab_in_bag(bag, grab) for grab in self.grabs) return all(grab_in_bag(bag, grab) for grab in self.grabs)
def parse_line(line: str) -> Game: def parse_line(line: str) -> Game:
line = line.strip() line = line.strip()