Idea · Sep 12, 2026

State Machine Story Engine

Students implement a finite state machine engine from scratch in TypeScript, then use it to build and publish an original interactive narrative game - earning deep FSM intuition through a creative deliverable peers can play.

What it would do

Students learn FSMs abstractly (vending machine diagrams) without building anything that runs. This multi-week assignment has two phases: (1) implement an FSM engine in TypeScript supporting states, transitions, guards, action callbacks, nested states, and a history pseudo-state; (2) use the engine to build an original interactive narrative game with at least three characters, two distinct endings, and a puzzle that requires reaching a specific FSM state sequence. A provided React+Vite game shell handles all rendering and keyboard input so students focus purely on the engine. An automated test harness validates the engine before the game phase begins. Finished games are published to a class gallery on Supabase where students play and review each other's stories. The assignment teaches FSM theory, event-driven programming, model-view separation, and TypeScript typing in a single arc.

Key features

  • FSM engine specification: states, transitions with guard functions, entry/exit actions, nested states, history pseudo-state
  • Automated test harness (Jest) that validates engine correctness before the game phase
  • React+Vite game shell students drop their engine into with zero rendering work
  • Supabase-hosted class game gallery with peer-play and a one-paragraph review rubric

More in Algorithms & Data Structures

Data Structure City

An explorable 'city' where each building is a live data structure (hash map, B-tree, skip list, LRU cache) that visibly restructures as students send commands.

BuiltAlgorithms & Data StructuresProduct for a businessSep 26, 2026

Big-O Sonifier

Converts an algorithm's live execution trace into sound, so students can hear the difference between O(n), O(n log n), and O(n^2) as the input size grows.

Algorithms & Data StructuresTeaching toolMediumSep 23, 2026

Build Your Own Type Inferencer

Students implement a Hindley-Milner type inference engine for a small functional language, guided by a step-through visual debugger that animates constraint generation, unification, and the final type environment in real time.

Algorithms & Data StructuresClass assignmentLargeSep 2, 2026

Build-Your-Own Vector Search Engine

Students implement a complete vector similarity search engine from flat brute-force cosine search to HNSW approximate nearest-neighbor search, wrapped in a Flask API, learning the algorithms and tradeoffs underlying every modern RAG and semantic search system.

Algorithms & Data StructuresClass assignmentLargeAug 29, 2026

All 27 ideas in Algorithms & Data Structures →