From 6289b819fcca784318733175df856dce47f7cc4c Mon Sep 17 00:00:00 2001 From: Joe Sweeney Date: Wed, 19 Apr 2017 17:19:39 -0400 Subject: [PATCH] Fix bug so we can compile game state --- src/CheckersGameState3.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CheckersGameState3.java b/src/CheckersGameState3.java index 5aca5ec..7c52cf5 100644 --- a/src/CheckersGameState3.java +++ b/src/CheckersGameState3.java @@ -292,7 +292,7 @@ public class CheckersGameState3 implements CheckersGameState{ //System.out.println("" + mypieces); return mypieces/total; } - + //features public boolean isLoner(int pos){ if(this.board[pos-5] == 0 && this.board[pos-4] ==0 && this.board[pos+4] ==0 && this.board[pos+5] ==0){ @@ -301,12 +301,12 @@ public class CheckersGameState3 implements CheckersGameState{ return false; } public boolean isSafe(int pos){ - if(this.board[pos%9==4] || this.board[pos%9==3]){ + if(pos%9==4 || pos%9==3){ return true; } return false; } - + public boolean isTerminal(){ double rat = pieceRatio(this.player); return (rat == 0 || rat == 1);