Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug in result function
  • 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
Expand Up @@ -240,7 +240,16 @@ public class CheckersGameState3 implements CheckersGameState{
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.