

This implementation of a Connect-4 game uses a minimax algorithm for the bot AI. The depth is 4 moves (approx. 7^4 = 2401 future states calculated), because any higher makes the decision time a couple minutes at best. Using the Connect-4 Starter Code and these Images for the Pieces to start, I coded the minimax algorithm using a rather basic evaluation function: I assigned the players piece a value of 1, the AIs piece a value of -1, and empty a value of 0. The value of a line (four in a row) is ...

Tap to see all activity →
No reviews for Connect4 (yehf-bxsci) yet
Be the first to write one.