Skip to content

Mexbow/-Connect-Four-with-Python-Pygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Connect Four with Python, Pygame & AI

image

An interactive version of the classic Connect Four game, built with Python and Pygame, featuring a clean GUI and an intelligent AI opponent using the Minimax algorithm with Alpha-Beta pruning.

🧠 AI Difficulty Levels:

  • Easy – Random AI
  • Medium – Minimax with shallow depth
  • Hard – Minimax with deeper search and Alpha-Beta pruning image

🎮 Game Modes:

  • Player vs Player
  • Player vs AI

🖥️ Features:

  • Smooth graphical user interface using Pygame
  • Real-time move previews
  • Win and draw detection
  • Reset and replay functionality
  • Object-Oriented clean codebase

🤖 Minimax + Alpha-Beta Pruning:

The AI uses the Minimax algorithm to evaluate game states and simulate optimal moves. Alpha-Beta pruning is applied to ignore unpromising branches, improving performance significantly at deeper levels. image

🚀 How to Run:

pip install pygame
python connect_four.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors