package jordan.game;

import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        int boardWidth = 8;
        int boardHeight = 8;
        AIPlayer ai = new AIPlayer(Side.HORIZONTAL, new BasicEvaluator());
        AIPlayer ai2 = new AIPlayer(Side.VERTICAL, ai, new BasicEvaluator());
        ai.setOpponent(ai2);

        Game game = new Game(ai, ai2, boardWidth, boardHeight);
        while (!game.isFinished())
        {
            printGameState(game);
            game.playNextTurn();
            System.out.println();
        }
        printEndResult(game);
    }

    private static void printEndResult(Game game) {
        System.out.println("Final state: ");
        printGameState(game);
        System.out.println(game.getWinner() + " is the winner because " + game.getNextPlayer() + " cannot play!");
    }

    private static void printGameState(Game game) {
        System.out.println(game.getNextPlayer() + " to play");
        BoardState boardState = game.getBoardState();
        printBoardState(boardState);
        printNextPlayer(game.getNextPlayer());
    }

    private static void printNextPlayer(Player player) {
        System.out.println("It's " + player + "'s turn");
    }

    private static void printTile(Tile tile) {
        System.out.print(tile.getOccupier().getPrintCharacter() + " ");
    }

    private static void printBoardState(BoardState boardState) {
        int rowIndex = 0;
        for (Row row : boardState.getRows()) {
            System.out.print(rowIndex++ + " ");
            row.getTiles().forEach(Main::printTile);
            System.out.println();
        }
        System.out.print("  ");
        for (Integer colIndex : IntStream.range(0, boardState.getWidth()).toArray())
        {
            System.out.print(colIndex + " ");
        }
        System.out.println();
    }
}

@@ -17,16 +17,43 @@
 ame;%0D%0A%0D%0A
+import java.time.Instant;%0D%0A
 import j
@@ -80,16 +80,16 @@
 tream;%0D%0A
-
 %0D%0Apublic
@@ -391,24 +391,135 @@
 nt(ai2);%0D%0A%0D%0A
+        //HumanPlayer jordan = new HumanPlayer(Side.VERTICAL, %22Jordan%22);%0D%0A        //ai.setOpponent(jordan);%0D%0A%0D%0A
         Game
@@ -567,24 +567,68 @@
 rdHeight);%0D%0A
+        Instant startTime = Instant.now();%0D%0A
         whil
@@ -769,32 +769,32 @@
 ();%0D%0A        %7D%0D%0A
-
         printEnd
@@ -804,24 +804,134 @@
 ult(game);%0D%0A
+        System.out.println(%22Game took %22 + (Instant.now().toEpochMilli() - startTime.toEpochMilli()) + %22ms%22);%0D%0A
     %7D%0D%0A%0D%0A   

Add timing to game runs to measure AI performance improvements