Skip to content

Commit

Permalink
Fix bug in jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
sas12028 committed Apr 5, 2017
1 parent 8388b88 commit 9d84c5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/CheckersGameState2.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private int[] neighbors(int index) {
private ArrayList<Move> findJumpMoves(int starting, int current, int[] path) {
ArrayList<Move> moves = new ArrayList<Move>();
int piece = board[starting];
board[starting] = 0;
int[] neighbors = neighbors(current);
int beg, end;
if(piece == 1) {
Expand Down Expand Up @@ -154,6 +155,7 @@ else if(piece == 2) {
}
}
}
board[starting] = piece;
return moves;
}

Expand Down

0 comments on commit 9d84c5e

Please sign in to comment.