piece if isonboard(xyand board[ ][ =othertilethere is piece belonging to the other player next to our +xdirection +ydirection if not isonboard(xy)continue rememberin order for this to be valid movethe first step in this direction must be on the board and must be occupied by the other player' tile otherwise there aren' any of the opponent' tiles to flipand valid move must flip over at least one tile if these two things aren' trueline ' condition isn' true and the execution goes back to the for statement for the next direction but if the first space does have the other player' tilethen the program should keep checking in that direction until it reaches one of the player' tiles if it reaches past the end of the board thoughthen line should continue back to the for statement to try the next direction while board[ ][ =othertile +xdirection +ydirection if not isonboard(xy)break out of while loopthen continue in for loop break if not isonboard(xy) continue the while loop on line keeps looping so that and keep going in the current direction as long as it keeps seeing trail of the other player' tiles if line detects that and moved off of the boardline breaks out of the for loop and the flow of execution moves to line what you really want to do is break out of the while loop but continue in the for loop this is why line rechecks not isonboard(xyand runs continuewhich moves execution to the next direction in line ' for statement rememberbreak and continue statements will only break or continue from the innermost loop they are in finding out if there are pieces to flip over if board[ ][ =tile there are pieces to flip over go in the reverse direction until we reach the original spacenoting all the tiles along the way while true