Source

ocaml-minigames / mills / mill.mli

Full commit
(*
indexes :
[ 0]----------[ 1]----------[ 2]
 |  [ 3]------[ 4]------[ 5] |
 |   |  [ 6]--[ 7]--[ 8] |   |
[ 9][10][11]        [12][13][14]
 |   |  [15]--[16]--[17] |   |
 |  [18]------[19]------[20] |
[21]---------[22]----------[23]
*)

type color = White | Black

type state

val make : unit -> state 
val copy : state -> state
  
val get_turn : state -> int
val end_of_turn : state -> unit
val unroll_turn : state -> unit
 
val get_color : int -> color
val get : state -> int -> color option

val get_count : state -> color -> int

val free_dots : state -> int list 
val colored_dots : state -> color -> int list
val neighbors : int -> int list
val free_neighbors : state -> int -> int list 
val capturables : state -> color -> int list
val movables : state -> color -> int list
val all_moves : state -> (int*int) list  
val all_flies : state -> (int*int) list

val can_put : state -> bool
val can_fly : state -> bool

val put : state -> int -> unit
val move : state -> int -> int -> unit
val fly : state -> int -> int -> unit
val capture : state -> int -> unit

val in_mill : state -> int -> bool
val connected : int -> int -> bool
val game_ended : state -> bool

val to_string : state  -> string