Tidy up code for 2024 day 12.
This still has some mutable state.
This commit is contained in:
@@ -114,6 +114,10 @@ module Grid : sig
|
||||
(** [Grid.get_by_pos grid pos] returns the character at position [pos] in
|
||||
[grid]. *)
|
||||
|
||||
val get_by_pos_opt : t -> int * int -> char option
|
||||
(** [Grid.get_by_pos_opt grid pos] returns [Some (get_by_pos grid pos)] if
|
||||
[pos] is a valid position in [grid], and [None] otherwise. *)
|
||||
|
||||
val pos_of_idx : t -> int -> int * int
|
||||
(** [Grid.pos_of_idx grid idx] returns the [(x, y)] position mapped by [idx]
|
||||
in [grid]. *)
|
||||
|
Reference in New Issue
Block a user