forked from SharifAIChallenge/AIC17-Client-Cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAI.cpp
26 lines (24 loc) · 719 Bytes
/
AI.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
#include "AI.h"
#include <ctime>
#include <cstdlib>
#include <iostream>
#include "Types.h"
void AI::doTurn(World *world)
{
/** Fill this method. We've presented a stupid AI as an example! **/
if (world->getCurrentTurn() == 0)
{
srand(time(NULL));
for (int i = 0; i < 3; i += 1)
for (int j = 0; j < 3; j += 1)
for (int k = 0; k < 2; k += 1)
{
world->changeStrategy(false, static_cast<CellState>(i), static_cast<CellState>(j), static_cast<CellState>(k), static_cast<Move> (1));
world->changeStrategy(true, static_cast<CellState>(i), static_cast<CellState>(j), static_cast<CellState>(k), static_cast<Move> (1));
}
}
else
{
/* never change strategy :p */
}
}