A small game with two interesting problems behind it: real-time multiplayer and an opponent that plays perfectly.

How I built it

Player vs AI

The AI uses the minimax algorithm: it explores every possible continuation of the game, scores the final positions, and picks the move that guarantees the best result assuming the opponent also plays perfectly. On a 3×3 board the full game tree is small enough to search on every move, so the AI never loses.

Player vs player

A Node.js server with Socket.io relays each move to the other player, so the board updates on both screens in real time without polling.

Front end

The interface is a React app. The game rules (win and draw checks) and the minimax search live in a separate utilities module.