@Test public void testWinningMoves() { final String boardString = "1 1 2 1 2 1 1 \n" + "1 1 0 1 0 1 0 \n" + "1 2 0 1 2 1 2 \n" + "2 0 2 1 2 0 0 \n" + "2 0 0 1 0 0 2 \n" + "0 2 2 0 2 2 0 "; Connect4Board board = new Connect4Board(boardFromString(boardString, BOARD_HEIGHT, BOARD_WIDTH)); assertTrue(Connect4.isWinningMove(3, BLACK, board)); }
public static boolean isWinningMove(int move, int playerColor, Connect4Board board) { Preconditions.checkArgument(move < Connect4Board.BOARD_WIDTH); return isConnect4(board.moveToPos(move), playerColor, board); }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { public static boolean isWinningMove(int move, int playerColor, Connect4Board board) { Preconditions.checkArgument(move < Connect4Board.BOARD_WIDTH); return isConnect4(board.moveToPos(move), playerColor, board); } }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { public static boolean isWinningMove(int move, int playerColor, Connect4Board board) { Preconditions.checkArgument(move < Connect4Board.BOARD_WIDTH); return isConnect4(board.moveToPos(move), playerColor, board); }  }
Connect4 implements BoardGame<Connect4Player, Connect4Player, Connect4State> { public static boolean isWinningMove(int move, int playerColor, Connect4Board board) { Preconditions.checkArgument(move < Connect4Board.BOARD_WIDTH); return isConnect4(board.moveToPos(move), playerColor, board); }  @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> { public static boolean isWinningMove(int move, int playerColor, Connect4Board board) { Preconditions.checkArgument(move < Connect4Board.BOARD_WIDTH); return isConnect4(board.moveToPos(move), playerColor, board); }  @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);  }