tempono
Bouwstenen/Toverkwadraat
Werkvorm · van tempono

Toverkwadraat

Een vierkant waarin elke rij, kolom en schuine lijn even veel is

Je assistent zet hem in een bundel met type: tempono/magic-square@1.0.0. Vraag bijvoorbeeld: “Gebruik de bouwsteen Toverkwadraat (tempono/magic-square@1.0.0) in opdracht 3.”

In de bibliotheek: De Denkclub: het geheim van het toverkwadraat.

Uitleg voor je assistent (Engels)
A magic square (toverkwadraat): every row, every column and (by default)
both diagonals add up to the same number, the magic sum. Write the **full
square**, top row first. Plain numbers are printed; `{ ask: n }` is an open
cell the pupil fills in, with its key. The booklet shows the square with the
rule and the magic sum; on the answer sheet the pupil writes each number in
its cell. Graded per cell.

| Setting | What it does |
| --- | --- |
| `rows` | 3 to 5 rows of as many cells. Every line must make the same sum. |
| `showSum` | `false`: the magic sum is not printed. The pupil works it out from a complete line (or from all numbers together) and writes it on the sheet too, for one more point. |
| `diagonals` | `false`: only rows and columns count. Easier to make, and the pupil can't use a diagonal. |
| `use` | The numbers to place, each once, printed as counters. Exactly the numbers of the open cells. Needed when subtracting from the sum isn't enough and the pupil has to try. |

Validation checks the square is magic, that `use` matches the open cells, and
that there is exactly one answer: either every open cell follows by
subtraction, or (with `use`, at most 9 open cells) only one way to place the
numbers fits.

Add a `solution`, the pupil's moves in order. Each move works out one cell
(`cell: [row, column]`, from 0) by a rule: `row`, `column` or `diagonal` (the
only empty cell of that line: the magic sum minus the rest), `try` (guess and
check), or works out the hidden magic sum: `magic` (a complete line) or
`total` (all numbers together divided by the number of rows; needs `use`).
Validation replays it; the manual shows the steps and the booklet gets a hints
sheet.

Easier: print more numbers, keep the sum visible. Harder: hide the sum, use
`use` with only two numbers printed (the classic 1 to 9 square), or a 4 × 4.

```yaml
- type: task
  id: q1
  prompt: Maak het toverkwadraat af.
  answer:
    type: tempono/magic-square@1.0.0
    rows:
    - [ 8, { ask: 1 }, 6 ]
    - [ { ask: 3 }, 5, 7 ]
    - [ 4, 9, { ask: 2 } ]
    solution:
    - { cell: [ 0, 1 ], rule: row, value: 1 }
    - { cell: [ 1, 0 ], rule: row, value: 3 }
    - { cell: [ 2, 2 ], rule: row, value: 2 }
```

Voorbeelden

Laden…