diff options
-rw-r--r-- | FICS/movecheck.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/FICS/movecheck.c b/FICS/movecheck.c index ce4db9a..6c93f9e 100644 --- a/FICS/movecheck.c +++ b/FICS/movecheck.c @@ -112,21 +112,25 @@ PUBLIC int is_move(char *mstr) return alg_is_move(mstr); } - -PUBLIC int NextPieceLoop(board_t b, int *f, int *r, int color) +PUBLIC int +NextPieceLoop(board_t b, int *f, int *r, int color) { - while (1) { - (*r) = (*r) + 1; - if (*r > 7) { - *r = 0; - *f = *f + 1; - if (*f > 7) - break; - } - if ((b[*f][*r] != NOPIECE) && iscolor(b[*f][*r], color)) - return 1; - } - return 0; + while (1) { + (*r) = (*r) + 1; + + if (*r > 7) { + *r = 0; + *f = *f + 1; + + if (*f > 7) + break; + } + + if (b[*f][*r] != NOPIECE && iscolor(b[*f][*r], color)) + return 1; + } + + return 0; } PUBLIC int |