Learning Connect 4

As part of teaching myself about AWS, I decided to build a bot to play Connect 4, the result of which you can play at connect4.andrewcho.xyz. Sorry the graphics are gnarly because CSS isn’t’ my strong-suit – I’ve been privileged to work with some very talented people who not only preferred but perhaps even loved working with CSS and rounded corners.

The AI is reasonable, it will beat you if you’re rusty. The game has been solved (a perfect player will always win if they have the first move). If you’re interested in being destroyed you can play connect4.gamesolver.org which has an excellent accompanying blog explaining the implementation.

For now I’d like to use my bot to train myself in the game. Personally I’m not a fan of the perfect player’s play-style in that it draws out the game until the board is almost completely full and forces the opponent to play in the last remaining open column. Connect 4 is a “somewhat of a national sport in Thailand” and also a common tourist scam. If I ever go to Thailand I don’t plan on being swindled, I plan to win!