Add Dukedom: the 1980 Creative Computing city-state sim

Add Dukedom: the 1980 Creative Computing city-state sim

#5 in Riparion/riparion-retro — merged 2026-06-09

Ports Dukedom (Kaapke, Creative Computing Feb 1980; lineage Hammurabi → Kingdom → Dukedom) to a mobile-first, fully client-side WASM Dioxus game, following NOTES.md with oregon-trail as the structural reference.

Engine (pure Rust, host-testable)

  • Faithful port of every formula and the original's C integer-truncation semantics, cross-checked against imports/dukedom.c.
  • Dukedom's procedural BASIC yearly loop adapted to a resumable single-Signal state machine: a serialized Phase cursor walked by run_phases(), full-screen inputs as Modes, in-stride decisions on a VecDeque<Interaction> queue, and a WarCtx sub-cursor so a refresh mid-war restores cleanly.
  • Per-game gauss event "climate" means (R[1..8]) and the BASIC RNG idioms (rnd1/fnr/fnx/gauss) rebuilt on retro_kit::rng::GameRng.
  • 15 tests: spec-anchored unit checks + multi-seed full-reign smoke + mid-war serde roundtrip.

Faithfulness decisions (confirmed)

  • Faithful, fix clear bugs: the Land screen lets you freely buy OR sell each year (original only offered sell if you bought 0); dead debug printfs dropped. Everything else (locust halving, plague immunity window, King/war math) stays exact.
  • Onboarding: a How-to-Rule help screen + one-line per-screen hints.
  • Scoring: tiered outcome ≫ years ≫ estate with a Serf→High King rank ladder.

UI / platform

Green-phosphor CRT aesthetic, localStorage auto-save + RESUME, local high-score table, installable per-game icons.

Shared work

  • New retro-kit components Decision and Notice; taipan refactored onto them.
  • Per the new NOTES.md version-bump convention: retro-kit and taipan0.1.1 (dukedom starts at 0.1.0).
  • gen-icons.mjs gains a dukedom crown glyph; game + root READMEs updated.

Verification

  • cargo test -p dukedom — 15/15 green.
  • Browser-driven (390×844) save/resume incl. mid-war, error-banner, and RESUME-survives-NEW-REIGN paths.

🤖 Generated with Claude Code

Last updated 2026-06-09