-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyBot.cc
35 lines (26 loc) · 880 Bytes
/
MyBot.cc
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
#include "Bot.h"
using namespace std;
/*
This program will play a single game of Ants while communicating with
the engine via standard input and output.
The function "makeMoves()" in Bot.cc is where it makes the moves
each turn and is probably the best place to start exploring. You are
allowed to edit any part of any of the files, remove them, or add your
own, provided you continue conforming to the input and output format
outlined on the specifications page at:
http://www.ai-contest.com
*/
int main(int argc, char *argv[])
{
cout.sync_with_stdio(0); //this line makes your bot faster
//reads the game parameters and sets up
cin >> state;
if (state.rows == 0 || state.cols == 0)
exit(0);
srandom(state.seed);
srand48(state.seed);
state.setup();
Bot bot;
bot.playGame();
return 0;
}