-
Notifications
You must be signed in to change notification settings - Fork 1
/
dumbBot.cpp
46 lines (38 loc) · 846 Bytes
/
dumbBot.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
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include "Utility.h"
using namespace std;
ifstream moveFile;
int main(int argc, char* argv[])
{
string fileName(argv[1]);
moveFile.open(fileName);
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]);
if (player == 1) {
// Move first
string move;
getline(moveFile, move);
cout << move << endl;
}
while (true)
{
string oppMove;
getline(cin, oppMove);
string move;
getline(moveFile, move);
cout << move << endl;
}
moveFile.close();
}