-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (28 loc) · 907 Bytes
/
main.cpp
File metadata and controls
34 lines (28 loc) · 907 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
#include "game.h"
#include "main.h"
int main() {
bool currPlayer = 0;
Game Game;
Game.BoardStartup();
Game.DisplayBoard();
bool Mat = false; /// false normalement
std::pair<position, position> move;
std::pair<position, position> bestNextMove = std::make_pair(Game.newPosition(0,0), Game.newPosition(0, 0));
//Game.perf();
unsigned long long keyArray[12][8][8];
Game.HashKey(keyArray);
Game.resetStat();
Mat = false;
while (!Mat) {
Game.incrTour();
currPlayer = !currPlayer;
if (currPlayer == 1) move = Game.iAPlayerV2(7, currPlayer, keyArray, &bestNextMove);
else move = Game.userMoveCmd(currPlayer);
Game.movePiece(currPlayer, move.first, move.second,1);
Mat = Game.checkForMat(!currPlayer);
//Mat = true; /// false normalement
if (Game.getNbrTour() > 200) Mat = 1;
Game.DisplayBoard();
std::cout << "CURR BOARD EVAL :" << Game.evalV2(!currPlayer) << std::endl;
}
}