@Test public void testPossibleMoves() { int N = 3; MutableBoard board = new MutableBoard(N); ArrayList<Integer> indeces; board.set(0, 1, RED); board.set(1, 1, BLUE); board.set(2, 1, RED); board.set(3, 4, RED); board.set(3, 1, WHITE); board.set(0, 1, RED); board.set(1, 1, BLUE); board.set(2, 1, RED); board.set(3, 1, RED); board.set(0, 1, BLUE); board.set(1, 1, WHITE); board.set(2, 1, RED); board.set(3, 1, RED); }
public ArrayList<Integer> possibleMoves(Side p, Board b) { ArrayList<Integer> indeces = new ArrayList<Integer>(); int length = b.size() * b.size(); for (int index = 0; index < length; index++) { if (b.isLegal(p, index)) { indeces.add(index); } } return indeces; }
AI extends Player { public ArrayList<Integer> possibleMoves(Side p, Board b) { ArrayList<Integer> indeces = new ArrayList<Integer>(); int length = b.size() * b.size(); for (int index = 0; index < length; index++) { if (b.isLegal(p, index)) { indeces.add(index); } } return indeces; } }
AI extends Player { public ArrayList<Integer> possibleMoves(Side p, Board b) { ArrayList<Integer> indeces = new ArrayList<Integer>(); int length = b.size() * b.size(); for (int index = 0; index < length; index++) { if (b.isLegal(p, index)) { indeces.add(index); } } return indeces; } AI(Game game, Side color); }
AI extends Player { public ArrayList<Integer> possibleMoves(Side p, Board b) { ArrayList<Integer> indeces = new ArrayList<Integer>(); int length = b.size() * b.size(); for (int index = 0; index < length; index++) { if (b.isLegal(p, index)) { indeces.add(index); } } return indeces; } AI(Game game, Side color); ArrayList<Integer> possibleMoves(Side p, Board b); }
AI extends Player { public ArrayList<Integer> possibleMoves(Side p, Board b) { ArrayList<Integer> indeces = new ArrayList<Integer>(); int length = b.size() * b.size(); for (int index = 0; index < length; index++) { if (b.isLegal(p, index)) { indeces.add(index); } } return indeces; } AI(Game game, Side color); ArrayList<Integer> possibleMoves(Side p, Board b);  }