Is The King In Check?
The boss. Is the black king attacked by anything at all — pawn, knight, bishop, rook, queen or the white king?
The whole board is one line. Squares run row-major from the top-left, an empty one is a dot, and between rows sit seven # — one fewer than the board is wide — so a diagonal or a knight jump that runs off the side lands on padding instead of wrapping onto the next rank. The black king is k; white pieces are uppercase P N B R Q K. The first row is rank 8, so white advances towards the start of the string. One square right is +1 and one square down is +15; every other offset you need is built from those two. Every piece at once. The pawn is the asymmetric one: white advances towards the start of the string, so a white pawn checks only from below the king — one above it is attacking the other way. Knights ignore blockers entirely. Bishops, rooks and queens are stopped by the first piece on the ray, whichever colour. The white king attacks all eight of its neighbours. And any of them may sit before or after the k in the string, so every case needs both directions.
Wrapped into rows of 8 so you can see the board. The string itself is one line with no line breaks in it — the 7 # between rows are ordinary characters, and a dot will happily match straight past them.
must match........#######........#######....k...#######...P....#######........#######........#######........#######........pawn
must match........#######........#######........#######..N.....#######....k...#######........#######........#######........knight
must match........#######....k...#######........#######........#######........#######....R...#######........#######........rook down the file
must match........#######........#######..k.....#######........#######....B...#######........#######........#######........bishop
must match........#######.Q......#######........#######...k....#######........#######........#######........#######........queen on the diagonal
must match........#######........#######........#######........#######....kK..#######........#######........#######........the white king itself
must not match........#######........#######..P.P...#######...k....#######........#######........#######........#######........pawns above the king attack away from it
must not match........#######....k...#######........#######....P...#######........#######....R...#######........#######........the rook is blocked
must not matchk.......#######........#######........#######........#######........#######........#######........#######..N..B.Rnothing in range
+ 26 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.