/
fight.h
45 lines (37 loc) · 866 Bytes
/
fight.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
#ifndef FIGHT_H
#define FIGHT_H
#include <bits/stdc++.h>
#include <stdlib.h>
#include "board.h"
#include "input.h"
#include "EngineConnector.h"
using namespace std;
void fight(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
bool player1Turn = true;
string position = "0000";
player1Name = "Stockfish";
player2Name = "Stockfish";
while(true){
cout << "asfs";
if(isMate(player1Turn)) {
cout << (player1Turn ? "Player 2 Wins.\n" : "Player 1 Wins.\n");
break;
}
//PrintBoard();
cout << flush;
if(player1Turn){
cout << "asfdasfasdsdafa";
string command = getEngineMove(position, player1Turn);
position += " " + command;
player1Turn = !player1Turn;
}else{
cout << flush;
string command = getEngineMove(position, player1Turn);
position += " " + command;
player1Turn = !player1Turn;
}
}
return;
}
#endif