-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboard.h
43 lines (37 loc) · 912 Bytes
/
board.h
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
#ifndef BOARD_H
#define BOARD_H
#include <vector>
#include <iostream> // std::cout
#include <algorithm> // std::merge, std::sort
#include <set>
#include <vector>
#include <quickunionunionfind.h>
#define SIZE 4
#define MaximizingPlayer 3
#define MinimazingPlayer -3
using namespace std;
class Board
{
private:
QuickUnionUnionFind *quuf = new QuickUnionUnionFind(SIZE*SIZE);
int board[SIZE*SIZE];
int PlayerTurn = MaximizingPlayer;
public:
Board();
void clear();
int GetPlayerTurn();
vector<int> getEmptyCells();
void nextPlayerTurn();
void undoMove(int i);
int maximizerWon();
int minimizerWon();
void undoMove(int i, int j);
bool hasEmptyCells();
int getCell(int x, int y);
int getCell(int x);
int hasWinner();
void Print();
void placeMove(int x, int y, int player);
void placeMove(int x, int player);
};
#endif // BOARD_H