aoc-2022-ocaml/src/grid.mli
ryan manseau 490696c63d make Grid.draw more flexible
- printer callback includes Vec2.t in the arguments now
- added optional rev_x and rev_y params
2024-01-03 09:18:57 -08:00

15 lines
633 B
OCaml

type 'a t [@@deriving show]
val at : 'a t -> Vec2.t -> 'a option
val at_e : 'a t -> Vec2.t -> 'a
val set_e : 'a t -> Vec2.t -> 'a -> unit
val ( .%() ) : 'a t -> Vec2.t -> 'a option
val ( .%()<- ) : 'a t -> Vec2.t -> 'a -> unit
val init : width:int -> height:int -> (Vec2.t -> 'a) -> 'a t
val of_lines : (char -> 'a) -> string list -> 'a t
val find : 'a t -> ('a -> bool) -> (Vec2.t * 'a) option
val count : 'a t -> ('a -> bool) -> int
val iter_region : 'a t -> Vec2.t -> Vec2.t -> (Vec2.t -> unit) -> unit
val iter : 'a t -> (Vec2.t -> unit) -> unit
val draw : 'a t -> ?rev_y:bool -> ?rev_x:bool -> (Vec2.t -> 'a -> char) -> string