-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBoard.cpp
62 lines (38 loc) · 1.12 KB
/
Board.cpp
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
#include"Board.h"
#include <vector>
//#include <fstream>
using namespace std;
BlockStatus (*Board::getBoard())[8] {
return m_board;
}
Board::Board() : isGameOver(false), isFull(false), isnoAvailable(false) {
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 8; ++j) {
m_board[i][j] = BlockStatus::EMPTY;
}
}
m_board[4][4] = m_board[3][3] = BlockStatus::BLACK;
m_board[3][4] = m_board[4][3] = BlockStatus::WHITE;
m_board[2][4] = m_board[3][5] = m_board[4][2] = m_board[5][3] = BlockStatus::AVAILABLE;
}
Board::~Board() {}
/*
/*
* You should complete the functions below.
* The things you could consider:
* 1. Reverse the pieces to Black
* 1. Compute all available position for AI.
* 2. Design an algorithm to make the best choice. And then set corresponding position to "WHITE". Reverse the pieces afterwards.
* 3. Recompute all available position for player and set correspoding position to "AVAILABLE"
*/
void Board::mouseClick(int i, int j) {
m_board[i][j] = BlockStatus::BLACK;
}
void Board::restart() {
}
void Board::Reverse(int i, int j) {
}
void Board::robot() {
}
void Board::setAvailable() {
}