Mat in 1 of mat in 2: de leerling kleurt het veld van het stuk en het veld waar het heen gaat
Uitleg voor je assistent (Engels)
A chess puzzle (schaakpuzzel): mate in 1 or mate in 2. The booklet shows the
position, whose move it is and the goal ("Wit is aan zet en geeft mat in 2").
The answer sheet has an empty board with coordinates; the pupil colours in two
squares: where the piece stands and where it goes. For a mate in 2 only the
first move. Any winning first move scores, not only the one in the solution.
| Setting | What it does |
| --- | --- |
| `fen` | The position in FEN: the placement from rank 8 down, then `w` or `b` for the side to move, then `- -`. Castling rights and en passant must be `-`; the move counters may follow or be left out. White or black may be to move. |
| `goal` | `mate1`: the side to move mates in one. `mate2`: it mates in two, whatever the other side replies. |
`solution` is the main line, as moves `{ from: d1, to: h5 }`: for `mate1` the
mate, for `mate2` three moves (the first move, a reply, the mate). The reply
can be any defence: the plugin checks every one itself.
Validation checks:
- the FEN reads, with one king each, no pawn on rank 1 or 8, and the side not
to move not in check;
- the goal is there: for `mate1` some move mates; for `mate2` some first move
mates against every reply, and there is no mate in 1;
- at most 3 first moves win, or the puzzle is too easy;
- no winning first move is a promotion (the sheet only takes two squares);
- the solution's first move is one of the winning ones, and every move is legal.
The rules are the plugin's own: no castling and no en passant, a pawn that
reaches the last rank becomes a queen.
The worked solution in the manual uses short notation: Dutch letters for `nl`
(K, D, T, L, P; a pawn has none), English for `en` (K, Q, R, B, N). The
scanner's feedback says why a wrong move fails: the reply that escapes ("Na
Dh5 kan zwart de koning wegzetten naar f8", "Na Dh5 speelt zwart g6, en dan is
er geen mat") or why the move can't be played.
Good puzzles are short and have one idea: a back-rank mate, a smothered mate,
a queen sacrifice before the mate. Check positions you take from a book with
validation: a position with a second, simpler mate is refused.
```yaml
- type: task
id: q1
prompt: Zoek het mat.
answer:
type: tempono/chess-puzzle@1.0.1
fen: 6k1/5ppp/8/8/8/8/8/R5K1 w - - 0 1
goal: mate1
solution:
- { from: a1, to: a8 }
```