int does_surround(int move, int dr) { if (DRAGON2(dr).surround_status) return 0; return compute_surroundings(dr, move, 0, NULL); }
void decide_surrounded(int pos) { int surround_status; if (board[pos] == EMPTY) { fprintf(stderr, "location must not be empty!\n"); return; } /* Prepare pattern matcher and reading code. */ reset_engine(); silent_examine_position(board[pos], EXAMINE_ALL); surround_status = compute_surroundings(pos, NO_MOVE, 1, NULL); if (surround_status == 1) gprintf("the dragon at %1m is SURROUNDED!\n", pos); else if (surround_status == 2) gprintf("the dragon at %1m is WEAKLY SURROUNDED!\n", pos); else gprintf("the dragon at %1m is not surrounded.\n", pos); }