Connect Four using MiniMax Algorithm and Alpha-Beta Pruning

The provided code implements a classic Connect Four game with a human player competing against an AI-driven computer opponent. The game is built using the Pygame library, allowing for an interactive graphical user interface (GUI).

Connect Four is a two-player connection game in which the players take turns dropping colored discs from the top into a vertically suspended grid. The objective of the game is to connect four of one's own discs in a row, vertically, horizontally, or diagonally, before the opponent.

The game logic includes functions for initializing the game board, making moves, validating locations, and checking for winning moves. The AI player employs the minimax algorithm, enabling it to make strategic decisions and providing a challenging opponent for the human player.

The graphical interface is created using Pygame, allowing for an engaging gaming experience. Players take turns placing their discs on the board, and the game continues until one player successfully connects four discs or the board is filled, resulting in a draw.

Clone the repository to give the game a shot! It is very difficult to beat the AI player!

Previous
Previous

Real Time Computer Vision Streamed via DJI Drone

Next
Next

Pukoban Solver using BFS, DFS, A*, and Greedy Search Algorithms