-
Notifications
You must be signed in to change notification settings - Fork 1
/
board.mli
42 lines (24 loc) · 1.04 KB
/
board.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
open Core
type t [@@deriving compare,sexp]
include Core.Comparable.S with type t := t
val bar : t -> player:Player.t -> int
val off : t -> player:Player.t -> int
val point_exn : t -> player:Player.t -> position:int -> Point.t
val remove_from_bar_exn : t -> player:Player.t -> t
val add_to_bar : t -> player:Player.t -> t
val add_to_off : t -> player:Player.t -> t
val remove_from_point_exn : t -> player:Player.t -> position:int -> t
val add_to_point_exn : t -> player:Player.t -> position:int -> t
val furthest_from_off : t -> player:Player.t -> [ `Bar | `Position of int | `Off ]
val winner : t -> (Player.t * Outcome.t) option
val pip_count : t -> player:Player.t -> int
val starting : t
val to_ascii
: ?show_pip_count:bool
-> ?viewer:Player.t
-> ?home:[ `Left | `Right ]
-> t
-> string
val to_representation : t -> [ `Original | `Modified | `Expanded ] -> to_play:Player.t -> float list
val to_snowie : t -> to_play:Player.t -> Roll.t option -> string
val of_snowie : string -> (t * [ `To_play of Player.t ] * Roll.t option) Or_error.t