Expand description
This is my solution for Advent of Code - Day 4: Ceres Search
Wordsearch
and its methods solve te solution today. Wordsearch::from_str
handles parsing the puzzle input.
Wordsearch::word_count
solves part 1, using apply_delta
, Wordsearch::char_at
, Wordsearch::get_word
,
and Wordsearch::words_from
, and Wordsearch::find_all
.
Wordsearch::count_x_masses
solves part 2, using Wordsearch::is_x_mas
, which in turn reuses some of the
part 1 helpers
StructsΒ§
- Wordsearch πA wordsearch grid
FunctionsΒ§
- apply_
delta πGetSome(coordinate)
that ismagnitude
distance along a line with a givendelta
. Returning None if applyingdelta * magnitude
is out of bounds. - The entry point for running the solutions with the βrealβ puzzle input.
Type AliasesΒ§
- Cell
Coords πA coordinate to a cell inWordsearch