aboutsummaryrefslogtreecommitdiff
path: root/motus/lib/validity.mli
blob: 3a597751e0fe4416123e1f5e12ab940fe4de1316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
type t =
  | Wellplaced
  | Misplaced
  | Missing

val elements : float
(** Number of elements in the sum type *)

val sequence : int -> t array Seq.t
(** Build a sequence of all the possible status for a given number of letters *)

val index_of_result : t array -> int
(** Get the index of a validity result *)

val index_to_result : base:int -> int -> t array

val to_criteria : char -> int -> t -> Criteria.t list -> Criteria.t list

val to_criterias : string -> t array -> Criteria.t list
(** Convert the validity result into a Criteria list, in the context of a given
    word  *)