@Test public void testCreateInitialState() throws Exception { Assert.assertEquals(BLACK, initialState.getPlayerToMove()); OthelloBoard board = initialState.getBoard(); Assert.assertEquals(WHITE, board.getValue(3, 3)); Assert.assertEquals(WHITE, board.getValue(4, 4)); Assert.assertEquals(BLACK, board.getValue(3, 4)); Assert.assertEquals(BLACK, board.getValue(4, 3)); double[] values = BoardUtils.getValues(board); int numEmptyLocations = 0; for (double val : values) { if (val == EMPTY) { numEmptyLocations++; } } Assert.assertEquals(60, numEmptyLocations); }
@Override public OthelloState createInitialState() { return new OthelloState(new OthelloBoard(), OthelloBoard.BLACK); }
OthelloRules implements GameRules<OthelloState, OthelloMove> { @Override public OthelloState createInitialState() { return new OthelloState(new OthelloBoard(), OthelloBoard.BLACK); } }
OthelloRules implements GameRules<OthelloState, OthelloMove> { @Override public OthelloState createInitialState() { return new OthelloState(new OthelloBoard(), OthelloBoard.BLACK); }  }
OthelloRules implements GameRules<OthelloState, OthelloMove> { @Override public OthelloState createInitialState() { return new OthelloState(new OthelloBoard(), OthelloBoard.BLACK); }  @Override OthelloState createInitialState(); @Override boolean isTerminal(OthelloState state); @Override List<OthelloMove> findMoves(OthelloState state); @Override int getOutcome(OthelloState state); @Override OthelloState makeMove(OthelloState state, OthelloMove action); boolean canPlace(OthelloBoard board, int row, int col, int player); @Override boolean isMaxPlayer(int currentPlayer); @Override double getReward(OthelloState state); }
OthelloRules implements GameRules<OthelloState, OthelloMove> { @Override public OthelloState createInitialState() { return new OthelloState(new OthelloBoard(), OthelloBoard.BLACK); }  @Override OthelloState createInitialState(); @Override boolean isTerminal(OthelloState state); @Override List<OthelloMove> findMoves(OthelloState state); @Override int getOutcome(OthelloState state); @Override OthelloState makeMove(OthelloState state, OthelloMove action); boolean canPlace(OthelloBoard board, int row, int col, int player); @Override boolean isMaxPlayer(int currentPlayer); @Override double getReward(OthelloState state);  }