PrintStream out = System.out;
long startTime, endTime;
for(int g = 0; g < numGames; g++)
{
konaneGame.resetBoard();
KonanePiece turn = KonanePiece.BLACK;
while(!konaneGame.isOver())
{
startTime = System.nanoTime();
Move move = agents[turn.ordinal()].computeMove();
endTime = System.nanoTime();
timings.put(turn.ordinal(),
timings.get(turn.ordinal()) + (endTime - startTime));
turn = turn.oppositeTurn();
konaneGame.makeMove(move);
}
int winner = turn.oppositeTurn().ordinal();
scores.put(winner, scores.get(winner) + 1);
}
this.playNumber++;
writer.write(String.format("Play number %d:\n", playNumber));
writer.write(String.format("\tBLACK (%s): Won %d games and took %f seconds.\n",