-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (34 loc) · 880 Bytes
/
main.cpp
File metadata and controls
42 lines (34 loc) · 880 Bytes
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
/* main.cpp */
#include <iostream>
#include <cstring>
#include "Board.h"
#include "Node.h"
using namespace std;
int main(int argc, char *argv[]) {
if(argc > 1 && strcmp(argv[1], "--help") == 0) {
cout << "Help! I need somebody. Help! Not just anybody. Help!!" << endl;
exit(0);
}
Board board;
srand(time(0));
int moves = 0;
int x = 0;
int y = 0;
while(moves < 30) {
moves++;
board.UCTSearch(10000);
cout << board << "------------------" << endl;
cin >> x;
cin >> y;
while(!board.makePlayerMove(x,y)) {
cout << "Illegal play!" << endl << "Try a different move" << endl;
cin >> x;
cin >> y;
}
cout << board << "------------------" << endl;
}
board.influence();
cout << "OK" << endl;
cout << "And the winner is... player " << board.getWinner() << endl;
return 0;
}