All-Different Variants, Revisited

A while back, I compared five implementations of the all-different constraint on generalized NxN Sudokus: Binary, Basic, Sparse, Pigeonhole, and Bipartite. The takeaway back then was a fairly tidy trade-off. Sparse and Basic were fastest on 16x16 grids, Binary dragged under the weight of too many small constraints, Pigeonhole held up reasonably well as grids grew, and Bipartite pulled away on 25x25 and 36x36 with steady, predictable runtimes.

Since then, the solver went through a heavy optimization pass - packing live domains into uint64 bitsets, adding custom propagators, and flattening search state out of Go maps into dense slices - along with targeted rewrites of Bipartite, Sparse, and Binary. I wanted to re-run the original study to see how much faster things got, which conclusions held up, and which ones flipped.

Solitude, Part 3: The Oracle

In Part 1 and Part 2, we built the island generator, live hints, and 2.5D canvas for Solitude. Rather than a public leaderboard, finishing Day 28 compares your score against two AI bots on the exact same island and weather schedule (with full move-by-move replays):

  • Master Strategist plays under the same fog of war and short weather forecast as a human.
  • Island Oracle sees the entire 21x19 map and all 28 days of weather from Day 1.

At first glance, Oracle sounds like the easy half of that pair: a deterministic, single-player game with zero hidden information. Getting both bots playing well inside a one-to-two-second budget on my shared E2-micro VM turned out to be the hardest search problem in the project.

Solitude, Part 2: 2.5D Canvas

In Part 1, we covered generating daily hex islands and Charter hints in Go for Solitude. This second post is about the TypeScript frontend.

Like my Crossword, Anarchy Chess, and Codeword apps, Solitude skips frontend frameworks and draws straight onto an HTML5 <canvas>. Unlike a flat 8x8 chessboard or 13x13 word grid, though, a 28-day island game lives or dies by how good the gameplay looks.

Anyone who has built a 2.5D game before already knows the tricks below; I hadn’t, so I walked straight into every standard trap one by one, so I’ll keep this post short.

Solitude, Part 1: The Island

After Anarchy Chess and Codeword, both of which have strict win conditions, I wanted to build something calmer and more open-ended. That turned into Solitude, a 28-day island homestead game played across four 7-day seasons. Each day gives you 5 action points (AP) and a 3-slot satchel for carrying wood and food. Pitching a camp creates a home base for storing supplies, and laying stone paths out from camp lets you walk and haul along them for 0 AP as you explore the fog, raise a sheltered cabin, and stock up for winter.

Because Solitude has more moving parts than my earlier games, I split this write-up into three short posts:

  • Part 1 (this post): generating daily hex islands, grading maps for interesting trade-offs, and solving live placement hints.
  • Part 2: what I learned the hard way building a 2.5D renderer and mobile UI.
  • Part 3: building the two end-of-year AI bots - and how beating my own Oracle bot exposed its blind spots.

Codeword: The Solver

After building Anarchy Chess, I wanted a daily word game to pair with it and landed on Codeword. A codeword starts with an open 13x13 crossword grid (around 120 white squares) with all of the clues removed. Instead, every white square carries a number from #1 to #26. Those numbers form a 1-to-1 substitution cipher for the alphabet: each number stands for one distinct letter from A to Z, all 26 letters appear somewhere on the grid, and typing L onto #2 fills every #2 square across the board.

Only two to four starter letters are revealed at the start, so cracking the rest is all about spotting word patterns and crossing letters. Under the hood, the Go CSP solver builds each day’s grids, checks that a human can deduce all 26 letters step by step without guessing, proves no second solution exists, and powers hints.

Anarchy Chess: The Solver

Way back in my first post on the solver, I used N-queens as a warm-up problem: place N queens on an NxN chessboard so none of them attack each other. Recently I turned a generalized version of that puzzle into a daily game called Anarchy Chess.

Instead of eight queens, each puzzle hands you a mixed tray of queens, rooks, bishops, and knights. In Anarchy mode, the board also comes with five immovable blocks: sliding pieces (queens, rooks, and bishops) stop at blocks, while knights jump right over them. Unlike the sudoku or crossword apps where you watch the solver show off, here you do the solving yourself while the Go CSP engine works backstage: verifying boards, cooking up balanced daily puzzles, and rescuing stuck players with hints.