day_15

Types

pub type Direction {
  Up
  Right
  Down
  Left
}

Constructors

  • Up
  • Right
  • Down
  • Left
pub type Map =
  grid.Grid(MapTile)
pub type MapTile {
  Wall
  Empty
  Robot
  Box
}

Constructors

  • Wall
  • Empty
  • Robot
  • Box

Functions

pub fn debug_map(map: Dict(#(Int, Int), MapTile)) -> List(String)
pub fn direction_to_string(direction: Direction) -> String
pub fn get_boxes_to_move(
  path: List(#(#(Int, Int), MapTile)),
) -> List(#(#(Int, Int), MapTile))
pub fn get_new_position(
  position: #(Int, Int),
  direction: Direction,
) -> #(Int, Int)
pub fn get_robot_col(
  map: Dict(#(Int, Int), MapTile),
) -> List(#(#(Int, Int), MapTile))
pub fn get_robot_path(
  line: List(#(#(Int, Int), MapTile)),
) -> List(#(#(Int, Int), MapTile))
pub fn get_robot_position(
  map: Dict(#(Int, Int), MapTile),
) -> #(Int, Int)
pub fn get_robot_row(
  map: Dict(#(Int, Int), MapTile),
) -> List(#(#(Int, Int), MapTile))
pub fn get_score(map: Dict(#(Int, Int), MapTile)) -> List(Int)
pub fn is_next_space_empty(
  path: List(#(#(Int, Int), MapTile)),
) -> Bool
pub fn main() -> Nil
pub fn move_boxes(
  map: Dict(#(Int, Int), MapTile),
  direction: Direction,
  boxes: List(#(#(Int, Int), MapTile)),
) -> Dict(#(Int, Int), MapTile)
pub fn move_robot(
  map: Dict(#(Int, Int), MapTile),
  direction: Direction,
) -> Dict(#(Int, Int), MapTile)
pub fn parse_direction(input: String) -> Direction
pub fn parse_input(
  input: List(String),
) -> #(Dict(#(Int, Int), MapTile), List(Direction))
pub fn parse_tile(input: String) -> MapTile
pub fn to_string(tile: MapTile) -> String
pub fn try_direction(
  map: Dict(#(Int, Int), MapTile),
  direction: Direction,
) -> Dict(#(Int, Int), MapTile)
pub fn update_map(
  map: Dict(#(Int, Int), MapTile),
  directions: List(Direction),
) -> Dict(#(Int, Int), MapTile)
Search Document