day07 package

Subpackages

Submodules

day07.day7 module

day7 solution.

class day07.day7.Hand(cards: str, bet: int)[source]

Bases: object

Simple hand class, uses cards_inted and of_a_kind for sorting.

CARD_MAPPING: ClassVar[str] = '23456789TJQKA'
bet: int
calculate_of_a_kind() list[int][source]

Figure out card sets.

cards: str
cards_inted: list[int]
of_a_kind: list[int]
class day07.day7.HandPart2(cards: str, bet: int)[source]

Bases: Hand

Part two; implements joker rule.

CARD_MAPPING: ClassVar[str] = 'J23456789TQKA'
calculate_of_a_kind() list[int][source]

Figure out card sets; jokers will be added to the biggest card set.

day07.day7.calculate_hands(cls: type, input_path: str) int[source]

Generates class cls then calculates points.

day07.day7.main() None[source]

Main func.

day07.day7.parse_lines(cls: type, path: str) list[Hand][source]

Open input file and parse into hand structures.

Module contents

day07 solution.