Skip to content

Commit

Permalink
Fix bug in result function
Browse files Browse the repository at this point in the history
  • Loading branch information
sas12028 committed Apr 5, 2017
1 parent 500ca7e commit 668f943
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CheckersGameState3.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,16 @@ else if(x.destination() > 30 && this.player == 1){
newState[k] = 0;
}
}
return new CheckersGameState3(1 - this.player, newState);
return new CheckersGameState3(other(this.player), newState);
}

private int other(int player){
if(player == 1){
return 2;
}
else{
return 1;
}
}

public void printState(){
Expand Down

0 comments on commit 668f943

Please sign in to comment.