diff --git a/src/CheckersGameState3.java b/src/CheckersGameState3.java index b7be28a..64864d7 100644 --- a/src/CheckersGameState3.java +++ b/src/CheckersGameState3.java @@ -199,6 +199,19 @@ public class CheckersGameState3 implements CheckersGameState{ return backward || forward; } + private boolean any_jumps(int pos){ + if(this.board[pos] == 1){ + if(any_jumps(pos, 4, 5, this.board, false)) return true; + } + else if(this.board[pos] == 2){ + if(any_jumps(pos, -4, -5, this.board, false)) return true; + } + else { + if(any_jumps(pos,4,5,this.board,true)) return true; + } + return false; + } + public List actions(){ return this.actions; } @@ -443,11 +456,14 @@ public class CheckersGameState3 implements CheckersGameState{ 2: num attacking pieces 3: central pieces 4: # pawns on diagonal + 2 * # kings on diagonal - 5: ^ same but for the two smaller diagonals + 5: bridge pattern + 6: triangle pattern + 7: dog pattern + 8: opponents kings are on the side. ] */ public double[] getEndGameFeatures(int player){ - double[] features = new double[6]; + double[] features = new double[9]; double total = 0.0; double mypieces = 0.0; for(int i = 0; i