-
Notifications
You must be signed in to change notification settings - Fork 0
/
play.cpp
66 lines (49 loc) · 1.47 KB
/
play.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "ConnectFour/Board.h"
#include "Player/RandomPlayer.h"
#include "Player/MonteCarloPlayer.h"
#include "Player/HumanPlayer.h"
#include "Player/MiniMaxPlayer.h"
#include "Engine/Engine.h"
#include "Engine/IMove.h"
#include "Pcg/pcg_random.hpp"
#include "Player/PRMonteCarloPlayer.h"
#include "Player/PLMonteCarloPlayer.h"
#include "Player/PMiniMaxPlayer.h"
#include "Player/PYBWMiniMaxPlayer.h"
#include <iostream>
#include <chrono>
#include <random>
// Change namespace to change game
using namespace ConnectFour;
// Plays a single game between two players
void single_game(IPlayer *p1, IPlayer *p2)
{
Board board;
Engine::play(&board, p1, p2, true);
}
int main()
{
// Player 1 *********************
HumanPlayer p1;
// RandomPlayer p1;
// MonteCarloPlayer p1(50, true);
// PRMonteCarloPlayer p1(50 / omp_get_max_threads(), true);
// PLMonteCarloPlayer p1(50, true);
// MonteCarloPlayer's strength can be set with thinking time.
//
// MiniMaxPlayer p1(6, true);
// PMiniMaxPlayer p1(6, true);
// PYBWMiniMaxPlayer p1(6, true);
// Player 2 *********************
// HumanPlayer p2;
// RandomPlayer p2;
MonteCarloPlayer p2(50, true);
// PRMonteCarloPlayer p2(50 / omp_get_max_threads(), true);
// PLMonteCarloPlayer p2(50, true);
// MiniMaxPlayer p2(6, true);
// PMiniMaxPlayer p2(6, true);
// PYBWMiniMaxPlayer p2(6, true);
// Mode ********************
single_game(&p1, &p2);
return 0;
}