Clicky

Back to Blog
AI & Development
6 min read

Building Sumito: How I Built a Strategy Board Game with Codex and Claude

I gave Codex one line and a link to a game site. It built a prototype, and Claude Code helped turn it into Sumito, an open-source strategy game.

Sumito promotional artwork showing the title, game description, and hexagonal board with dark and light marbles

I’ve always been a fan of strategy board games, and I played a lot of chess and checkers growing up. Recently I came across Abalone, a game where you push your opponent’s marbles off a hexagonal board. I liked it straight away.

So I decided to make my own version. An open-source one.

I didn’t write a spec. I pointed Codex at the Abalone website with one line:

I want to make a game similar to Abalone. My version of the game.

It one-shotted a decent prototype. The board, the marbles, the moves and the pushes all worked. I then handed that code to Claude Code, and over three evenings I turned it into a full game: a computer opponent, a tutorial, and puzzles. It all runs in the browser, with nothing to install.

This post covers how that happened, where I still had to step in, and what went into making it open source.

Play Sumito · Read the source on GitHub

A Familiar Game, My Own Version

Abalone was designed by Michel Lalet and Laurent Lévi in 1987. Each player has fourteen marbles. You move lines of up to three marbles, and you can push a smaller line of your opponent’s. Push six of their marbles off the board and you win.

A push needs a numbers advantage: three against two, or two against one. In Abalone, that advantage is called a sumito. It felt like the right name for my version.

The Prototype Codex Built

The first version came out in one shot: a hexagonal board, two sets of marbles, movement, pushing, captures, and a score.

That’s a lot to work out from one line and a link. A hex board needs a coordinate system. Moving a line sideways is different from pushing it forward. Whether a push is legal depends on how many marbles are on each side and what’s behind them. All of that has to agree, or the game breaks.

I hadn’t explained any of it. Codex picked up the rules from the site and got them right. That gave me something I could actually play, and a codebase to build on.

Turning It Into a Real Game with Claude Code

From there I moved to Claude Code. I’d point it at the repo, or at a problem I’d found, and ask it to dig in.

One example: I asked Claude Code to review the repo for usability, interaction, animation, speed, and mobile play. It came back with an interactive review document. It had 32 suggestions, grouped by layout, text, motion, interaction, speed, and accessibility, each with file and line references. It even included a live demo of a possible push animation.

Sumito review document listing 32 suggestions built, 31 fully tested, one open point, and 159 passing browser checks

Most of the work after that was a simple loop. I played on my phone, took screenshots, and sent notes like “This screen isn’t self-explanatory” or “There’s a glitch when I rotate the phone.” Claude Code traced the problem back to the code, fixed it, and added a test so it wouldn’t come back.

That’s how the game picked up most of its features:

  • A computer opponent with three difficulty levels, plus hints with short explanations.
  • A tutorial played on the board, four illustrated rules, and three tactical puzzles.
  • Readable movement: marbles slide, captured marbles fall, and the score visibly changes.
  • Phone and desktop layouts, including a landscape view with scores on the left and actions on the right.
  • Synthesized sound effects, so the game needs no separate audio files.
The How to play panel with four illustrated cards explaining selection, movement, pushing, and the win condition

What I Still Needed to Do

The agents did most of the building, but they didn’t catch everything. On my desktop, a menu button overlapped the title, yet every automated test passed. The test browser didn’t report hover support, so it never ran the styles that caused the bug. Claude Code fixed it and added a check, but I had to spot it first.

That was the pattern throughout: I played the game, noticed what felt wrong, and sent it back.

The AI That Plays the Game

There are two kinds of AI in this project. Codex and Claude Code helped write the game. The computer opponent inside it uses something much older: minimax with alpha-beta pruning, a classic game-search method. No language model is involved.

It ranks the legal moves, searches the most promising ones, and looks ahead at the opponent’s replies. A hand-written scoring function judges each position:

  • Captures count the most, because pushing six marbles off wins the game.
  • Keeping your own marbles comes next.
  • Central positions, connected groups, and fewer marbles on the edge add to the score.

The three levels differ in how far ahead they look and how many moves they consider:

LevelLooks aheadMoves searched per positionHow it picks
EasyIts own moveUp to 12Randomly from its top 4
MediumIts move and your replyUp to 14Randomly from its top 2
HardIts move, your reply, its next moveUp to 18Always its best move

On Easy and Medium, if the top move captures a marble, it takes that move instead of picking randomly.

The hints compare the board before and after a move and give a short reason, such as “wins a marble immediately,” “improves central control,” or “connects the formation.” They’re simple teaching cues, not a language model explaining itself.

Two small choices make the opponent easier to follow. The search normally runs in a Web Worker so the board stays responsive, with a fallback to the main thread if the worker fails. And the computer waits at least 350 milliseconds before it moves, so you see a short pause and then the marbles slide.

The AI implementation notes explain the search and its tests in more detail.

Open Source From Day One

I wanted people to be able to play, read, change, and build on the game from the start. Sumito is released under the MIT licence.

The rules engine is a pure TypeScript module, kept separate from the interface and network code. If you want to try a different interface, a stronger opponent, or another platform, you can start from it.

For AI experiments, the repo also includes a Python copy of the rules with a PettingZoo adapter for reinforcement learning.

Play It, Inspect It, Build On It

Sumito is live and free, with no ads or accounts. You can play a friend on one device, take on the computer, or start with the one-minute tutorial.

Puzzle solved result card showing a 6–0 score and Next puzzle, Retry, and Back to start buttons

This is what a shared replay looks like: a full 146-move match, played back from one link. Turn the sound on to hear the moves.

And a challenge: beat the computer on Hard, tap Share on the result card, and post the link in the Beat Hard challenge thread, or send it to me.

I wanted my own version of a game I liked. Now it’s out there for anyone to play, break, or improve. If you build something on top of it, I’d love to see it.

Sumito is an independent fan-made game inspired by Abalone. It is not affiliated with, endorsed by, or sponsored by Abalone’s trademark owner or publisher. The code and game artwork were made for Sumito. The title fonts are Cinzel and Cinzel Decorative, credited in the repository.

Kashif Aziz · AI Integration

Want this workflow integrated into your product?

I design practical AI features and automation that reduce manual work.