finds.dev

unclebob/spacewar

Space War starting in Episode 55 of cleancoders.com

View on GitHub

★ 676Clojureupdated May 2026

// the take

A Star Trek-themed space strategy game written in ClojureScript by Uncle Bob (Robert C. Martin), built as a companion to his Clean Coders screencast series. It's a full-featured browser game with resource management, tactical combat, and a galaxy-spanning campaign. If you're interested in seeing what idiomatic functional game logic looks like in Clojure, this is a concrete example.

The game logic is structured as pure functions operating on immutable state, which is exactly what you'd expect given the author — the separation between `game_logic/` and `ui/` is clean and the spec coverage across all game systems (klingons, shots, bases, clouds, romulans) is genuine. The `.cljc` extension throughout means the same code compiles to both Clojure and ClojureScript, which is a real architectural commitment, not an afterthought. The game itself has surprising depth — resource economics, line-of-supply logistics, damage degradation, enemy AI behavioral states — more design than you'd expect from a screencast demo. Deps.edn with `:cljs` and `:cljs-prod` aliases keeps the build story minimal and reproducible.

This is a teaching artifact, not a maintained open-source project — the README points to cleancoder.com and there's no contribution guide, issue tracker engagement, or roadmap. The UI layer is all custom widgets in ClojureScript with no component library, meaning the rendering code is tightly coupled to Quil/canvas conventions that aren't documented anywhere in the repo. Save state is a flat file (`spacewar.world`) with no versioning, so any schema change in game logic silently breaks existing saves. There's also no CI configuration, so the spec suite only runs if you know to run it manually.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
676
Forks
68
Language
Clojure
Last commit
5 May 2026

// nearby

If spacewar isn't quite it.

All repos →