← projectsUltimate Tic Tac Toe
// project — Ultimate Tic Tac Toe

Ultimate Tic Tac Toe

Nine boards and a rival you build yourself. Create it, beat it, improve it.

Ultimate Tic Tac Toe — captura
01// historia

Tic-Tac-Toe with Extra Dimensions

In my first semester I was a bit ahead in Intro to Programming. I'd already taken a course and knew Pygame, a way to build simple 2D games without reaching for Unity or Godot. And I was obsessed with a paper game: tic-tac-toe with extra dimensions, where every move sends your opponent to another board. It's a bit like chess that way: every move matters, but it matters later.

02// decision

A Game Instead of an Exam

I made my professor a deal: if I built a playable tic-tac-toe in Python and in Java, she'd excuse me from the midterm. I knew nothing about Java. She said yes.

Back then people talked about Blackbox, an AI coding model; no Claude, no Codex. It took me weeks, something I'd now do in an afternoon or two. I finished it with every rule of the game in Pygame, playable and, for my level, amazing. I had a lot of fun. I wanted to play on my own, but I didn't know how to build an agent, so I made a random one. It was terrible, but it played with me.

03// historia

Connect 4 Brought the Agent Back

Years later I took Foundations of AI and we learned to build small reinforcement-learning agents that play Connect 4. It sounds unrelated, but it reminded me a lot of that random agent. I decided to improve the interface and add a space inside the app to write AI scripts and play against them.

This time I took more risks. I'd been poking at Rust and the Tauri framework, so I used Rust's speed to run the agents in a desktop app. With Claude Code's help it came together pretty easily.

04// arquitectura

Rust AI Engine & External Agents

Game tree evaluation runs on a dedicated Rust background thread via Minimax with Alpha-Beta pruning and Monte Carlo Tree Search (MCTS). I also created a runtime interface for third-party Python agents with a strict 5-second per-move timeout.

9 (81 cells)
sub-boards
Alpha-Beta · MCTS
algorithms
14 game rewards
achievements
In-game match view

↳ Active board highlighting and tactical state management across nested grids.

05// decision

Real-Time Multiplayer with SHA-256 Hashes

Online multiplayer runs over WebSockets. Every move payload includes a SHA-256 hash of the entire board state. If any desynchronization is detected between players due to network latency, the board resynchronizes immediately without dropping the match.

Home screen and mode selection

↳ Game mode selector: local pass-and-play, AI duel, or online matchmaking.

06// decision

Agents Built from Blocks

Later I was invited to help at the AI Engineer for a Day workshop at Universidad de La Sabana. The question was how to get people who had never coded, and who had no idea what MCTS or Minimax were, to have fun building something interactive. I remembered the blocks I learned to program with in school.

That was the idea: build Ultimate Tic Tac Toe agents out of blocks, but blocks that push creativity instead of limiting it. Many situations you think through when playing for real became blocks you can snap together. Then a tournament with every agent to see who had built the best one.

07// resultado

Build Your Rival

I grew the app: it's now web with Next.js, desktop with Tauri, and mobile with React Native. The point isn't to hand you a prebuilt bot to play against, but to let you play against your own creation. Build your rival, beat it, and make it better.

Built with:Tauri 2.0, Next.js, React Native, Rust, Zustand, Supabase, and WebSockets.
next project
caligrama→

A poem you can read that also draws what it's about.