Algorithms & games2026
Arcade
Six classic games, each with an opponent or a solver whose thinking you can watch.
Languages
- JavaScript
- HTML
- CSS
- C11
Frameworks & tools
- Web Workers
- Canvas API
- Make
See it in action
Project preview
Battleship, Wordle, Minesweeper, Connect Four, the sliding puzzle and Snake, each with its thinking switched on.
The challenge
Battleship started as a class assignment: one game and one clever opponent. I wanted a single place that shows a range of algorithms and data structures at work, not just described.
The idea
Six classics side by side, each built on a different idea from computer science: probability for Battleship, information theory for Wordle, constraint solving for Minesweeper, adversarial search for Connect Four, IDA* for the sliding puzzle and graph search for Snake. One switch shows what each algorithm is computing while you play.
The build
Plain JavaScript with no build step and no server. Battleship reuses my C11 parity engine unchanged. Minesweeper enumerates frontier layouts with backtracking and union find, Connect Four runs negamax with alpha beta pruning and a Zobrist hashed transposition table, and the sliding puzzle is solved optimally in a Web Worker with an incremental linear conflict heuristic.
What came out of it
A playable arcade that doubles as a demo of the ideas behind it. The Minesweeper probabilities match a brute force check exactly, the Wordle solver needs 3.4 guesses on average, and the Snake autopilot regularly grows past 100 squares.
More technical detail in the project repository. Implementation notes ↗