Task
A pure mirror checkmate is a checkmate position, where the mated king is surrounded by 8 empty squares which are attacked or guarded by the winning side exactly once. You will be given a valid chess position where Black is in mate. Your task is to find if that mate is a pure mirror checkmate.
Examples (click for larger images)
This is a pure mirror mate. Squares f5, g5, are protected by the king only, h5, h6, h7 by the rook only and f6, f7, g7 by the two knights only.
This position does not match the criteria. It is a mirror mate, but it's not pure, as d7 is guarded by the bishop and attacked by the rook.
This position is not a pure mirror mate as well, since the king is not surrounded by 8 empty squares.
This is a pure mate, but not a mirror mate (not all 8 squares surrounding the king are empty), therefore it doesn't meet the criteria:
Input
As mentioned above, your input will be a valid chess position, where black will be in mate. You may take the input as an FEN or as a grid/matrix/2D array. From the examples above:
first position:
4N2N/4q3/6k1/8/5K2/8/8/7R . . . . N . . N . . . . q . . . . . . . . . k . . . . . . . . . . . . . . K . . . . . . . . . . . . . . . . . . . . . . . . . R
second position
8/R7/4k3/2P3P1/3K4/7B/8/8 . . . . . . . . R . . . . . . . . . . . k . . . . . P . . . P . . . . K . . . . . . . . . . . B . . . . . . . . . . . . . . . .
third position
7b/8/8/5N2/8/7k/5N2/7K . . . . . . . b . . . . . . . . . . . . . . . . . . . . . N . . . . . . . . . . . . . . . . . k . . . . . N . . . . . . . . . K
fourth position:
2NN4/4k3/1b2NNb1/8/6N1/8/6K1/q6n . . N N . . . . . . . . k . . . . b . . N N b . . . . . . . . . . . . . . . N . . . . . . . . . . . . . . . K . q . . . . . . n
Rules
- The chess position will always be valid and black will always be in mate.
- There will be no double checks (the king won't be attacked twice).
- You can receive input through any of the standard IO methods.
- This is code-golf, so shortest code in bytes wins!
guard chess
on google, all is some variant with a piece named guard \$\endgroup\$S
is not currently attacked by the white pieceX
but it would be if the black king moves there. (Like the white bishop on d7 in the 2nd test case.) \$\endgroup\$