Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added bridge feature
  • Loading branch information
Elaine Tsun authored and Elaine Tsun committed Apr 26, 2017
1 parent b1825e5 commit 93234de
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/CheckersGameState3.java
Expand Up @@ -521,6 +521,23 @@ public class CheckersGameState3 implements CheckersGameState{
}
return false;
}
/* feature: bridge pattern*/
private boolean isBridge(int player){
if(player == 1){
if((this.board[0]==1) && (this.board[2]==1){
return true;
}
}
else if(player == 2){
if((this.board[32]==2) && this.board[34]==2){
return true;
}
}
return false;
}
private boolean isTriangle(int player){
return false;
}

public boolean isTerminal(){
return this.actions.size() == 0;
Expand Down

0 comments on commit 93234de

Please sign in to comment.