-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
65 lines (52 loc) · 1.58 KB
/
index.d.ts
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
56
57
58
59
60
61
62
63
64
65
interface Obj {
key: number;
index: number;
column: number;
}
declare namespace ModuleConnect4 {
class Connect4<PLAYER> {
public map: {
[x: number]: Obj[];
};
players: [PLAYER, PLAYER];
readonly plays: number[];
private __finished: boolean;
readonly winner: null | number;
readonly solution: null | Obj[];
readonly lengthArr: number;
readonly columns: number;
readonly necessaryToWin: number
readonly _lastTurn: number;
readonly start: null | number;
readonly turn: number;
public play(played: number): void;
public canPlay(play: number): boolean;
readonly array: Obj[][];
private checkArr(arr: Obj[]): {
encontrado: number;
veces: number;
solution: Obj[];
};
readonly tie: boolean;
readonly finished: boolean;
public createBoard(): {
[x: number]: Obj[];
};
public reset(): this;
constructor(options: {
lengthArr: number;
columns: number;
necessaryToWin: number;
}, players: [PLAYER, PLAYER]);
}
class Connect4AI<PLAYER> extends Connect4<PLAYER> {
playAI(difficulty: "easy" | "medium" | "hard"): number;
constructor(options: {
lengthArr: number;
columns: number;
necessaryToWin: number;
}, players: [PLAYER, PLAYER], recursiveDepthLimit?: number);
}
export { Connect4, Connect4AI };
}
export default ModuleConnect4;