Hidden pieces

In a hidden pieces puzzle, chess pieces are concealed behind numbers. Each number tells you how many squares that piece attacks from its position. Your task is to deduce which piece is behind each number, both the color and type.

Kings may stand next to each other; there may be multiple kings of any color; multiple kings may be in check; and pawns of either color may appear on the first or last ranks. The position does not need to be legal or reachable in a real game. Board dimensions are not necessarily 8×8 and may vary from puzzle to puzzle. The only chess knowledge required is how pieces attack.

Important: You may place pieces only on squares that contain numbers. Empty squares without numbers must remain empty.

Attack rules: A piece attacks all empty squares and opponent pieces it can reach, but never friendly pieces.

  • Pawns attack diagonally forward (white upward, black downward – even on smaller boards). A white pawn on the top rank or a black pawn on the bottom rank will always show 0.
  • Pins do not matter in this puzzle: a piece "attacks" according to its normal movement, even if that move would be illegal in a real game due to a pin.
  • Sliding pieces (bishop, rook, queen) do not attack squares behind other pieces.

Here's an example. In this following scenario, the rook on a3 would show 4 (attacking a1, a2, b3, c3), the knight on c2 would show 1 (it only attacks the empty square a1), and the pawn on c3 would show 0.

All "hidden pieces" problems: