public void play(BestMoveFinder bestMoveFinder) throws Throwable {
        initImages();
        int[][] board = null;
        int[][] oldBoard = null;
        while (true) {
            int[][] newBoard = null;
            for (int i = 0; i < 5; i++) {
                newBoard = readBoard();
                if (validate(board, oldBoard, newBoard)) {
                    break;
                }
            }
            board = newBoard;
            oldBoard = copyBoard(board);
            Move move = bestMoveFinder.findBestMove(board);
            System.out.println("\nMove = " + move + "\n");
            pressKey(move);
        }
    }