-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.mli
55 lines (47 loc) · 1.12 KB
/
types.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
43
44
45
46
47
48
49
50
51
52
53
54
55
(* [move] defines the types of moves within the game *)
type move =
| Regular
| Evil
| Left
| Right
| Up
| Down
| Null
(* key defines the types of actions within the game *)
type key =
| Move of move
| Regular
| Evil
| New
| Greedy
| Corner
| Random
(* [square] defines a square in the board *)
type square = int option
(* [board] matrix of squares *)
type board = square array array
(* [score] current score in the game *)
type score = int ref
(* [state] is the current state of the game including
* evil: whether in Evil or Regular mode
* s: current score
* b: current board *)
type state = {
evil: bool ref;
s: score;
b: board;
}
(* movePair defines a 2-tup of two consecutive moves *)
type movePair = move * move
(*score_to_moves defines a list of score-movePair 2-tups.
* [score] is the resulting score of moving the two
* moves in [movePair] *)
type score_to_moves = (score * movePair) list
(* staticState defines a static state in time, consisting
* of the current evil boolean flag, score (int ref), and
* static board. *)
type staticState = {
e: bool;
score: score;
board: board;
}