@Test public void testIsConnect4() { Connect4Board board = createTestBoard(); Assert.assertEquals(false, Connect4.isConnect4(Board.BLACK, board)); board.makeMove(5, Board.BLACK); Assert.assertEquals(true, Connect4.isConnect4(Board.BLACK, board)); board.setValue(3, 5, Board.EMPTY); Assert.assertEquals(true, Connect4.isConnect4(board.moveToPos(5), Board.BLACK, board)); }
static boolean isConnect4(int playerColor, Connect4Board board) { for (int pos : board.getOccupiedCells(playerColor)) { if (isConnect4(pos, playerColor, board)) { return true; } } return false; }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { static boolean isConnect4(int playerColor, Connect4Board board) { for (int pos : board.getOccupiedCells(playerColor)) { if (isConnect4(pos, playerColor, board)) { return true; } } return false; } }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { static boolean isConnect4(int playerColor, Connect4Board board) { for (int pos : board.getOccupiedCells(playerColor)) { if (isConnect4(pos, playerColor, board)) { return true; } } return false; }  }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { static boolean isConnect4(int playerColor, Connect4Board board) { for (int pos : board.getOccupiedCells(playerColor)) { if (isConnect4(pos, playerColor, board)) { return true; } } return false; }  @Override GameOutcome play(Connect4Player blackPlayer, Connect4Player whitePlayer, RandomDataGenerator random); @Override GameOutcome play(Connect4Player blackPlayer, Connect4Player whitePlayer, Connect4State initialState,
			RandomDataGenerator random); static boolean isWinningMove(int move, int playerColor, Connect4Board board); }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { static boolean isConnect4(int playerColor, Connect4Board board) { for (int pos : board.getOccupiedCells(playerColor)) { if (isConnect4(pos, playerColor, board)) { return true; } } return false; }  @Override GameOutcome play(Connect4Player blackPlayer, Connect4Player whitePlayer, RandomDataGenerator random); @Override GameOutcome play(Connect4Player blackPlayer, Connect4Player whitePlayer, Connect4State initialState,
			RandomDataGenerator random); static boolean isWinningMove(int move, int playerColor, Connect4Board board);  }