types.bend
minebender-game@1.0.0.0 · 63 lines · 10 definitions
1import Base
2
3
4
5
6
7def Grid(-A: Data) -> Data:
8 List<&2, List<&2, A>>
9
10
11type Pos is Data:
12 Pos{x: Nat, y: Nat}
13
14
15
16type Seen is Data:
17 Hidden{}
18 Shown{n: Nat}
19 Boom{}
20
21
22
23type Knowledge is Data:
24 Knowledge{w: Nat, h: Nat, mines: Nat, rows: Grid(Seen)}
25
26
27
28type Action is Data:
29 Reveal{p: Pos}
30 Chord{p: Pos}
31 Flag{p: Pos}
32 Assist{k: Nat}
33
34
35
36type Loss is Data:
37 Exploded{p: Pos}
38 AssistTooEarly{safe: Pos}
39
40type Status is Data:
41 Playing{}
42 Won{}
43 Lost{why: Loss}
44
45
46type Level is Data:
47 Beginner{}
48 Intermediate{}
49 Expert{}
50 Custom{w: Nat, h: Nat, mines: Nat}
51
52type Setup is Data:
53 Setup{w: Nat, h: Nat, mines: Nat}
54
55
56type Tile is Data:
57 Covered{}
58 Flagged{}
59 Number{n: Nat}
60 Blast{}
61 Mine{}
62 BadFlag{}
63 Hint{}