Skip to content

Commit

Permalink
Added apexHeuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed May 1, 2016
1 parent 220d8db commit e986903
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/model/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,13 @@ public int apexHeuristic(Color color) {

noKings = (color == Color.BLACK && this.blackKings == 0) ||
(color == Color.WHITE && this.whiteKings == 0);
if (piece7.getColor() == color) {
if (piece7 != null && piece7.getColor() == color) {
eitherSquaresOccupiedByActiveMan |= active7;
neitherSquaresOccupiedByPassiveMan &= active7;
}
if (piece26.getColor() == color) {
if (piece26 != null && piece26.getColor() == color) {
eitherSquaresOccupiedByActiveMan |= active26;
}

if (piece7.getColor() == color && piece26.getColor() == color) {
if ()
neitherSquaresOccupiedByPassiveMan &= active26;
}

if (noKings && eitherSquaresOccupiedByActiveMan && neitherSquaresOccupiedByPassiveMan)
Expand Down

0 comments on commit e986903

Please sign in to comment.