advent_of_code_2024

Module day_4

source
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Β§

FunctionsΒ§

  • apply_delta πŸ”’
    Get Some(coordinate) that is magnitude distance along a line with a given delta. Returning None if applying delta * magnitude is out of bounds.
  • The entry point for running the solutions with the β€˜real’ puzzle input.

Type AliasesΒ§