SelfscribeDownloadOpen the app

Chess games

Replay a famous game move by move, and set puzzles, from standard notation.

Interactive · Simple · uses games, calendar

Edit it in the playgroundRead the file

What it shows

Hand a block to a plugin, and it draws a chess game, a board or a calendar.

What you learn

A block rule whose target is a plugin, two kinds of block for one plugin, boxes that fold, a calendar of events, emoji by short name.

Try this

  • Add a line "2026-12-22 19:00 Puzzle night @ Northgate Library" to the calendar, and it appears among the dates.
examples/chess-club.self · 101 lines
~~~ selfscribe
# Lesson: Hand a block to a plugin, and it draws a chess game, a board or a calendar.
# You learn: a block rule whose target is a plugin, two kinds of block for one plugin, boxes that fold, a calendar of events, emoji by short name.
# Try this: add a line "2026-12-22 19:00 Puzzle night @ Northgate Library" to the calendar, and it appears among the dates.
# summary: Replay a famous game move by move, and set puzzles, from standard notation.
# category: fun
# tags: interactive, simple, social
# uses: games, calendar
use markdown
set title Chess games
set heading-font Playfair Display

# ---- Colours, each with its shade for dark pages -------------------------------------
palette
  club  #7a4a1e  dark #e0b27a

# ---- "~ Northgate Chess Club · December 2026": the bulletin's line above the title -----
line   ~ _                 -> div.masthead  { font: 700 0.72em/1 var(--doc-font-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--club); padding-bottom: 0.9em; margin-bottom: -1.2em; border-bottom: 2px solid var(--club) }  as cc-masthead

# ---- Chess: a ```pgn block is a game to step through, a ```chess block one position --------
# Both go to the chess plugin. `verbatim` hands it the text exactly as typed.
block  ``` chess ... ```   -> chess   verbatim
block  ``` pgn ... ```     -> chess   verbatim

# ---- "::: tip- Hint" … ":::": a box with an icon; the first word is its kind ---------------
# A dash after the kind starts it folded, so the answer stays hidden until it is clicked.
block  ::: _ ... :::       -> callout kind=_1

# ---- An ```events block: one dated line per event, drawn as a calendar --------------------
block  ``` events ... ```  -> events  verbatim

# ---- ":trophy:" is an emoji by its short name ---------------------------------------------
inline :_:                 -> emoji
~~~
~ Northgate Chess Club · December 2026

# The Opera Game

Paris, 1858. Paul Morphy, with White, against the Duke of Brunswick and Count Isouard in their box at the opera. Seventeen moves, and every one of them counts.

```pgn
[Event "Paris Opera"]
[Site "Paris FRA"]
[Date "1858.??.??"]
[White "Paul Morphy"]
[Black "Duke Karl / Count Isouard"]
[Result "1-0"]

1. e4 e5 2. Nf3 d6 3. d4 Bg4 {A pin that costs Black time.} 4. dxe5 Bxf3 5. Qxf3 dxe5
6. Bc4 Nf6 7. Qb3 {Two attacks at once, on b7 and on f7.} Qe7 8. Nc3 c6 9. Bg5 b5
10. Nxb5 {Morphy gives a piece to open lines.} cxb5 11. Bxb5+ Nbd7 12. O-O-O Rd8
13. Rxd7 Rxd7 14. Rd1 Qe6 15. Bxd7+ Nxd7 16. Qb8+ {The queen gives herself up.} Nxb8
17. Rd8# {Mate with the last two pieces.} 1-0
```

Click a move to see the board at that point, or click the board and use the arrow keys. Black never got the king's bishop or the rook on h8 into the game.

## Puzzle of the month :bulb:

White to play and mate in two. A problem often credited to Morphy himself.

```chess
kbK5/pp6/1P6/8/8/8/8/R7 w - - 0 1
```

::: tip- Hint
The rook can give itself up. Which black pawn cannot move?
:::

::: success- Solution
White plays 1. Ra6. If Black takes with 1... bxa6, then 2. b7 is mate. If the bishop moves anywhere, 2. Rxa7 is mate. The pawn on a7 cannot move: it shields its own king from the rook.
:::

## December at the club

Club nights are free for members and £3 for visitors. Bring a board if you have one.

```events
2026-12-03 19:00 Club night: rook endings with Priya Raman @ Northgate Library
2026-12-10 19:00 Blitz, five minutes a side @ Northgate Library
2026-12-17 19:00 Simul: Tomasz Wróbel against twenty boards @ Town Hall
2026-12-28..2026-12-29 Christmas congress @ St Anne's School
```

The congress has a trophy :trophy: for the best player under sixteen. Entries close on 20 December.

## How it's made

- Each fenced block is handed to a plugin by one rule in the rules block. The `pgn` block is a game you can replay. The `chess` block is one position, written as a FEN line.
- `::: tip- Hint` is a box with an icon. Its first word is the kind (`tip`, `success`, `warning`…), and the dash after it starts the box folded.
- The `events` block is one line per event: a date, a time, the title and `@ place`. The calendar marks the next one from today.
- Emoji are written by name between colons, like `:bulb:` beside the puzzle.

## Try it yourself

1. Add `2026-12-22 19:00 Puzzle night @ Northgate Library` to the calendar. It appears among the dates, in order.
2. In the game, write `{Castling was safer.}` after `6. Bc4 Nf6`. The comment shows beside that move.
3. Add `[Orientation "black"]` under the game's other headers. The board is seen from Black's side.
4. Change `::: tip- Hint` to `::: tip Hint`. The hint is open from the start.

Next: *Card games* deals and scores poker hands; *Sheet music* hands a tune to the music plugin.