day11 package
Subpackages
Submodules
day11.day11 module
day11 solution.
- class day11.day11.Galaxy(row: int, col: int, id: int)[source]
Bases:
object
Galaxy represented as its position and unique id.
- col: int
- distance(other: Galaxy, universe: Universe) int [source]
Return distance from one galaxy to another.
Accounts for “expanded” spaces in the universe
- id: int
- row: int
- class day11.day11.Point(row: int, col: int, item: str)[source]
Bases:
object
Point represented by character and whether it is expanded.
- col: int
- get_point_distance(expansion_rate: int) int [source]
Returns how big this “point” is based on if its expanded.
- is_expanded: bool = False
- item: str
- row: int
- class day11.day11.Universe(contents: list[list[Point]], expansion_rate: int = 2)[source]
Bases:
object
Universe class; 2d array of . and #.
- col_lookup: list[int]
- expanded_to_lookup(expanded_items: list[int], size: int) list[int] [source]
Convert from
[3,7]
,10
to00011112222
.
- expansion_rate: int = 2
- init_lookups(expanded_rows: list[int], expanded_cols: list[int]) None [source]
Initialize lookup tables.
- num_cols: int
- num_rows: int
- row_lookup: list[int]
Module contents
Day11 solution.