-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoard.h
55 lines (46 loc) · 1.04 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef BOARD_H
#define BOARD_H
#include <iostream>
#include <vector>
#include "math.h"
#include <string>
#include <sstream>
using namespace std;
class Board{
public:
Board();
vector<Board> NextPossibleBoards;
void CopyBoard(Board Model);
void DrawBoard();
void ScoreNodesInTree();
Board* MakeMachineMove(int mark);
void CreateTree();
Board* FindNextBoard(int space, int first);
int FindOpenSpace(int index);
void SetBestMoveX(int index);
void SetBestMoveO(int index);
void SetWinnerOfPath(int PlayerTurn, int index);
bool XWinsHorizontally();
bool OWinsHorizontally();
bool XWinsVertically();
bool OWinsVertically();
bool XWinsDiagonally();
bool OWinsDiagonally();
int Winner();
bool FullBoard();
bool GameIsOver();
void PrintEndOfGameMessage(int first);
int GetUserInput();
bool operator==(Board OtherBoard);
void SetScore(int x);
void SetTurn(int x);
void SetState(int x, int y);
int GetState(int x);
int GetScore();
int GetTurn();
private:
int score;
int turn;
int state[9];// 1 for X, -1 for O, 0 for nothing
};
#endif