Idea · Oct 7, 2026
Build Your Own Micropolis
A staged assignment where students build a SimCity-style city simulator from scratch: zoning grid, power-network flood fill, traffic pathfinding, diffusion-based land value and pollution, and a growth model that ties them together.
What it would do
Inspired by a Show HN post of a SimCity clone written entirely in Emacs Lisp, this assignment uses the city builder as a vehicle for a semester's worth of core algorithms. Phase 1 is a tile grid with zoning and a render loop. Phase 2 adds the power grid as connected-component labeling (BFS flood fill from power plants). Phase 3 adds traffic: each zone sends trips to the nearest job or shop tile using Dijkstra on the road graph, with congestion feeding back into edge costs. Phase 4 adds pollution, crime and land value as diffusion over the grid (repeated blur kernels), and Phase 5 adds the growth rule that lets zones develop or decay based on those fields. Each phase ships with deterministic seed maps and expected snapshots, so autograding compares field values rather than screenshots.
Key features
- Five phased milestones, each mapping to one algorithmic idea (grid modeling, flood fill, shortest paths, diffusion, cellular rules)
- Deterministic seeded maps with golden JSON snapshots for autograding each subsystem independently
- Debug overlays students must implement: power coverage, traffic heatmap, land value field
- Performance target (a 128x128 city ticking at 30 Hz) that motivates incremental updates over full recomputation
- Optional stretch: budget and tax model, or a 'mayor agent' that places zones to maximize population