Eric WagonerandClaude Fable 5.1 605f8c511b Caddy routes the duel server's paths with handle blocks, from one template
try_files ran before reverse_proxy and rewrote /api to the shell; handle
blocks are exclusive. Both setup scripts render deploy/Caddyfile.tmpl.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 17:15:58 -04:00

Waving Hands

A browser remake of Richard Bartle's 1977 pencil-and-paper wizard duel, also known as Spellbinder and Spellcaster, and the game behind Andrew Plotkin's Spellcast for X Windows.

Each turn both wizards secretly choose a gesture for each hand, then reveal them together. The right run of gestures on one hand is a spell. Gestures can overlap, so F-F-F casts Paralysis and following it with S-S-D-D finishes a Fireball. Both palms at once is surrender.

The full rules, as transcribed from the Duel Purpose fanzine, are in docs/waving-hands-rules.txt.

Playing

npm install
npm run dev

You duel a heuristic bot. Each turn, choose a gesture per hand, pick which completed spell (if any) each hand casts and at whom, and reveal. The rules are at /rules.

Around the two hands:

  • the ledger of every gesture both wizards have made, with completed spells named;
  • beneath each hand, the spells it is part-way through, one click from the next gesture, with a pin to keep one in view; every spell-sheet entry can also be planned with either hand;
  • warnings citing the opponent's gestures that could finish a hostile spell, which light those gestures up in the ledger when selected;
  • after each reveal, a strip of what changed each wizard's health and everything else worth knowing, and a one-time explanation when a rule decided something surprising;
  • the full chronicle and the spell sheet in the sidebar.

The duel is saved to the browser's local storage after every change, so it survives reading the rules, a refresh, or a phone putting the tab to sleep. Starting a new duel asks first if one is under way. Nothing is rendered on the server.

Layout

  • src/lib/game/spells.ts the spell book and monster stats
  • src/lib/game/gestures.ts sequence matching, threat detection, gesture-sharing conflicts
  • src/lib/game/state.ts the duel's state and the seeded random source
  • src/lib/game/resolve.ts simultaneous turn resolution
  • src/lib/game/bot.ts the opponent
  • src/lib/game/duel.svelte.ts reactive store binding the engine to the UI, saved to local storage
  • src/lib/components/ the ledger, hand pickers, status panels, result strip, chronicle, spell sheet, and the sticky bar for phones
  • src/routes/rules/ the rules page, rendered from the spell book and the transcription in docs/

Simplifications

Raise dead only heals; there is no one left to raise in a two-wizard duel once someone dies. Paralysis and charm person pick the hand at cast time rather than after the reveal. A hastened wizard's second pair of gestures is bound by the same enchantments as the first. Under time stop the frozen wizard's ledger shows a row of question marks, so they know a stopped moment passed even if nothing touched them.

The bot

The opponent scores every pair of gestures by the spells they finish, the spells they move toward, and what your visible gestures threaten. Spells it cast in the last few turns are discounted so it does not fall into a rut, and each named opponent weights the spell book a little differently.

Deploying

See deploy/README.md: one small droplet running Caddy serves the static build.

Tests

npm test

Credits

The gesture silhouettes on the buttons and the favicon are adapted from the bitmaps in Andrew Plotkin's Spellcast for X Windows (1993). Its notice: "This implementation is by Andrew Plotkin. It is copyright 1993 by Andrew Plotkin. The source code may be freely copied, distributed, and modified, as long as this copyright notice is retained. The source code and any derivative works may not be sold for profit without the permission of Andrew Plotkin and Richard Bartle."

S
Description
A browser duel of gestures, after Richard Bartle's Waving Hands (1977)
Readme
634 KiB
Languages
TypeScript 63.5%
Svelte 32.6%
Shell 1.7%
CSS 0.9%
HTML 0.8%
Other 0.5%