Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added centHeuristic()
  • Loading branch information
top13001 committed May 1, 2016
1 parent 49ca835 commit b025432
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/model/Board.java
Expand Up @@ -490,17 +490,18 @@ public class Board {
int[] coordinates = {11,12,15,16,20,21,24,25};

for (int value : coordinates){
Location piece_loc = samuelMapping(value);
if (isOccupied(piece_loc)==true){


Location piece_loc = samuelMapping(value);
Piece chosen_piece = getPiece(piece_loc);
if (isActive(chosen_piece)==false
&& chosen_piece.getType()==Type.NORMAL && chosen_piece.getColor() == color){

if (isActive(chosen_piece)==false && chosen_piece.getType()==Type.NORMAL
&& chosen_piece.getColor() == color){
heuristicval +=1;
}
}
}

return 0;
return heuristicval;
}

/**
Expand Down

0 comments on commit b025432

Please sign in to comment.