Back to browse
Welter's game, a little Nim-like combinatorial game

Welter's game, a little Nim-like combinatorial game

by fuglede_·Jun 9, 2026·2 points·0 comments

AI Analysis

●●SolidNiche GemCozy

Winning positions map to constant weight binary lexicode error-correcting codes.

Strengths
  • Reveals non-obvious math: game strategy equals decoding Conway-Sloane lexicodes.
  • Built to explain author's actual work to kids—authentic educational motivation.
Weaknesses
  • Combinatorial game theory is extremely niche; most players won't care about the math.
  • Less well-established than Nim; winning strategy isn't as cleanly documented.
Category
Target Audience

Math enthusiasts and parents teaching combinatorial game theory

Similar To

Nim game implementations · Combinatorial Game Suite

Post Description

Hi HN! Here's a little game I (and my buddy Claude, cf. the obvious CSS gradient tell on the title) set up to explain to my kids some of things we were working on at work.

So in the game you're taking turns moving coins down a line until no moves are possible. If you've taken a course on combinatorial game theory, you'll have come across the game of nim and you can think of this one as a variant of nim where there can only be a single coin in every square. The theory of how to play it isn't quite as well-established as for nim though; play with enough coins and I certainly find it quite tricky to mentally reason about whether a position is good or not.

One fun fact about Welter's game is that its winning positions form the codewords of a particular error-correcting code called the constant weight binary lexicode (Conway and Sloane, 1986). What that means is that being good at the game is the same as being good at decoding messages in that code. Probably more fun to just play the game though.

Similar Projects

Gaming●●Solid

Addictive little browser game involving gravity

Retroburn captures the satisfying tug-and-thrust of old gravity-ship games: Newtonian gravity, atmospheric drag, and a neat risk/reward twist where using thrust eats your score. It's impressive how much is packed into a ~1.2k-line single-file HTML app (<50KB): procedural planets, tight keyboard controls, and quick sessions make it an addictive proof-of-concept rather than a platform-shifting release.

CozyRabbit Hole
amiralul
333mo ago