Connect 4 Bot and interface
Posted on
Over the past week, I built a simple Connect Four game, complete with a bot and a user interface that includes an evaluation bar—taking inspiration from the computer analysis found on platforms like chess.com and lichess.org. Here's the game:
Play as:
I've been planning to get back to working on a chess engine, and this project was a great way to brush up on concepts like search trees and alpha-beta pruning. I also wanted to have some fun designing a user interface for the game.
Notes:
A couple of observations: Connect Four is a solved game, meaning the first player can always win if they play perfectly. So, even with a strong bot, the first player has a built-in advantage. As for the evaluation in the UI, it's based on counting three-in-a-row streaks at a depth of six. I kept the depth low to avoid any latency, though I might add an option to change it if I revisit this project in the future.