Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed May 1, 2016
2 parents 553371f + b025432 commit 0a6b609
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
35 changes: 33 additions & 2 deletions src/model/Board.java
Expand Up @@ -464,13 +464,44 @@ public class Board {
}

public int backHeuristic(Color color) {

if (whiteKings + blackKings == 0){
if (color == Color.BLACK){
Location thirty = samuelMapping(30);
Location thirty_two = samuelMapping(32);

if ((isActive(getPiece(thirty)) == false) && (isActive(getPiece(thirty_two))==false)){
return 1;
}
}
else { // White color
Location one = samuelMapping(1);
Location three = samuelMapping(3);

if ((isActive(getPiece(one)) == false) && (isActive(getPiece(three))==false)){
return 1;
}
}
}
return 0;
}

public int centHeuristic(Color color) {
int heuristicval = 0;
int[] coordinates = {11,12,15,16,20,21,24,25};

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

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

return heuristicval;
}

/**
Expand Down

0 comments on commit 0a6b609

Please sign in to comment.