Welcome to the Connect Four repository! This project brings the classic Connect Four board game to life in a digital format. Players take turns dropping colored discs (blue or orange) into a 7x6 grid, aiming to be the first to connect four in a row, column, or diagonal. Whether you're challenging a friend, testing your skills against a clever AI, or watching two AIs compete, this game offers a fun and strategic experience for everyone.
-
Multiple Game Modes:
- 1 Player (vs AI): Face off against a smart AI powered by the Minimax algorithm with alpha-beta pruning. Capable of planning up to 7 moves ahead, the AI recognizes patterns and delivers a tough challenge. Can you outwit it?
- 2 Players: Enjoy a classic two-player match on the same device, perfect for a quick showdown with a friend.
- AI vs AI: Sit back and observe as two AI players compete, showcasing strategic decision-making and intriguing gameplay.
-
Intuitive Interface: The game features a clean and user-friendly design. The grid displays blue and orange discs on a gray background, while the main menu sports a stylish logo of four discs (two orange, two blue) in a 2x2 arrangement against a white backdrop.
-
Engaging Gameplay: Drop discs into the grid and watch the action unfold in real time. The interface clearly announces the winner with messages like "AI won!" (or similar), ensuring every game ends with a satisfying conclusion.
-
Choose Your Mode: From the main menu, select "1 Player (vs AI)", "2 Players", or "AI vs AI" using the vibrant buttons—blue for 1 Player, orange for 2 Players, and purple for AI vs AI.
-
Drop Your Disc: Click or tap a column to place your disc (blue or orange). It will fall to the lowest open spot in that column.
-
Win the Game: Connect four discs in a row, column, or diagonal before your opponent does. If the grid fills up without a winner, it's a draw!
-
Back to Menu: Hit the "Back to Menu" button to return to the main screen and start a new game.
The AI in this game is powered by the Minimax algorithm with alpha-beta pruning, a classic technique in game development that optimizes decision-making. This implementation balances performance and user experience, making it a great resource for anyone interested in AI or game programming.
Ready to dive in? Follow these steps:
-
Clone the Repository: Use
git clone
to download the project to your local machine. -
Set It Up: Check the repository for detailed setup instructions (e.g., dependencies, build steps).
-
Play or Contribute: Run the game to play, explore the code, or even add your own features!
Whether you're a gamer, developer, or AI enthusiast, this Connect Four project has something for you. Enjoy the game and happy coding! 🎮