-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
45 lines (36 loc) · 963 Bytes
/
main.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
#include "Utility.h"
#include "Player.h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
// #include <assert.h>
using namespace std;
bool testerUtility();
int main(int argc, char **argv)
{
// testerUtility();
// return 0;
int player;
int N;
double timeLeft;
// Take the game parameters from console
Utility util;
string input;
getline(cin, input);
vector<string> ins = util.splitString(input);
player = stoi(ins[0]);
N = stoi(ins[1]);
timeLeft = stof(ins[2]);
// Seeding for random number generation
srand(time(NULL));
// cin >> player >> N >> timeLeft;
player = (player == 1) ? 1 : -1;
// Spawn an instance of Player and play the game
Player *yinsh = new Player(player, N, timeLeft, time(NULL));
yinsh->playGame();
// yinsh -> game -> displayBoard();
// yinsh -> game -> dispLims();
// yinsh -> game -> displayNrows();
return 0;
}