public void testFillGapInPotentialOpposingSeriesOfFour() throws Exception { board.setPosition(4, 7, Board.HUMAN_PLAYER_MARK); board.setPosition(5, 6, Board.HUMAN_PLAYER_MARK); board.setPosition(7, 3, Board.HUMAN_PLAYER_MARK); board.setPosition(7, 4, Board.HUMAN_PLAYER_MARK); assertEquals(Board.getSingleCoordValueFor(6, 5), game.makeMove()); }
public void testWeCanBlockASeriesOfFour() throws Exception { board.setPosition(4, 5, Board.HUMAN_PLAYER_MARK); board.setPosition(4, 6, Board.HUMAN_PLAYER_MARK); board.setPosition(4, 7, Board.HUMAN_PLAYER_MARK); board.setPosition(4, 8, Board.HUMAN_PLAYER_MARK); assertEquals(Board.getSingleCoordValueFor(4, 9), game.makeMove()); }
public void testFindTesseraEndingBlockingPositionBeforePairStartingPosition() throws Exception { board.setPosition(2, 3, Board.HUMAN_PLAYER_MARK); board.setPosition(3, 2, Board.HUMAN_PLAYER_MARK); board.setPosition(3, 3, Board.COMPUTER_PLAYER_MARK); board.setPosition(3, 4, Board.COMPUTER_PLAYER_MARK); board.setPosition(3, 5, Board.COMPUTER_PLAYER_MARK); board.setPosition(3, 6, Board.COMPUTER_PLAYER_MARK); assertEquals(Board.getSingleCoordValueFor(3, 7), game.makeMove()); }
public boolean positionIsAvailable(int row, int column) { return board.positionIsEmpty(row, column); }
public boolean positionIsAvailable(int playerMove) { return board.positionIsEmpty(playerMove); }
public int getPosition(int position) { return board.getPosition(position); }
public void setBoard(int[] incomingBoardArray) { board.setBoardArray(incomingBoardArray); }
public void markMove(int position, int playerMark) { int row = Board.getRowCoordFor(position); int column = Board.getColumnCoordFor(position); board.setPosition(row, column, playerMark); view.drawMark(row, column, playerMark); }
public void testOnSecondMoveWePickShadowPosition() throws Exception { board.setPosition(4, 5, Board.HUMAN_PLAYER_MARK); int position = game.makeMove(); assertEquals(Board.getSingleCoordValueFor(5, 4), position); }