Connect 4

Learning to create AI models that know to play games

Try it!



Visit the GitHub Repo

Description


Context: The NOAI competition requires implementing game-playing AI from scratch — no ML libraries, pure algorithm design. I needed a practice project that forced me to implement real search and evaluation logic.

Challenges: Writing a DFS-based minimax evaluator that's fast enough to be playable in real time. A transposition table and symmetry caching were added to avoid re-evaluating equivalent board states. I also had to build a pixel-based board reader to interface with the game running on screen, without any game API.

Result: A fully functioning Connect 4 AI that plays strong moves in real time, reading live game state from the screen via pixel detection. The minimax + transposition table combination keeps decision time under a second per move.