-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathhuman_bot.cpp
More file actions
36 lines (28 loc) · 834 Bytes
/
human_bot.cpp
File metadata and controls
36 lines (28 loc) · 834 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
#include "player.h"
#include "utils.h"
#include <iostream>
#include <cstdlib>
int main(int argc, char *argv[]) {
std::cout.precision(2);
std::cout.setf(std::ios::fixed,std::ios::floatfield);
srand(static_cast<unsigned int>(time(nullptr)));
Game game=OTHELLO;
if (argc>1) game=parse_game(argv[1]);
Board *board=choose_game(game);
float bottime = static_cast<float>(1.);
if (argc>2) bottime = parse_float(argv[2],bottime);
Player *player_a;
Player *player_b;
if (argc>3) {
player_a=new PlayerBot(PLAYER_1,bottime,0,0.3);
player_b=new PlayerHuman(PLAYER_2);
} else {
player_a=new PlayerHuman(PLAYER_1);
player_b=new PlayerBot(PLAYER_2,bottime,0,0.3);
}
play_game(player_a,player_b,board);
delete board;
delete player_a;
delete player_b;
return 0;
}