-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cpp
More file actions
52 lines (38 loc) · 1.15 KB
/
Main.cpp
File metadata and controls
52 lines (38 loc) · 1.15 KB
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
#include <cstdlib>
#include <iostream>
#include "Chessboard.h"
#include "Engine.h"
using namespace std;
Move moveWrapper(Chessboard& board, string input) {
Move m;
m.fromX = input[0] - 'a';
m.fromY = input[1] - '1';
m.toX = input[2] - 'a';
m.toY = input[3] - '1';
return m;
}
int main(int argc, char** argv) {
Chessboard board(DEFAULT_BOARD);
Engine engine;
bool turn = WHITE;
string input;
MeasuredBoard measuredBoard;
displayBoard(board);
while (input != "quit") {
cin >> input;
Move m = moveWrapper(board, input);
if (validateMove(board, m, turn)) {
move(board, m);
cout << "White's turn:" << endl;
// board = engine.getBestMove(board, WHITE, 2);
displayBoard(board);
cout << "Black's turn:" << endl;
board = engine.getBestMove(board, BLACK, 3);
}
displayBoard(board);
cout << "Score: " << (int)engine.getInitialMeasure(board).score << endl;
// measuredBoard = engine.getInitialMeasure(board);
// engine.getValidMoves(measuredBoard, BLACK);
}
return 0;
}