By: Dory Z, Karan C
Connect Four is a classic two-player connection game where players place colored discs into a vertical grid, attempting to connect four pieces in a line. Connect 4 SPIN introduces a new element to the game: each column can be flipped vertically, and players must spin the column after each piece placement. Pieces are fixed in position so they don't fall when a column spins. This creates a dynamic game where a piece at the bottom can randomly move to the top when its column is flipped, making a winning strategy less predictable. We will explore how AI agents handle uncertainty in strategic games, comparing expectimax algorithms with traditional minimax approaches and investigating how randomness affects optimal play.
Mac/Linux:
cd backend
python3 main.pyWindows:
cd backend
python main.pyStep 1: Install Dependencies
Mac/Linux:
cd backend
pip install -r requirements.txtWindows:
cd backend
pip install --user -r requirements.txtNote: On Windows, use --user flag to avoid permission issues.
Step 2: Start the Backend API Server
Mac/Linux:
cd backend
python3 api.pyWindows:
cd backend
python api.pyThe API server will start on http://localhost:5000
Step 3: Open the Frontend
Mac:
cd frontend
open index.htmlOr double-click index.html in Finder.
Windows:
cd frontend
start index.htmlOr double-click index.html in File Explorer.
Linux:
cd frontend
xdg-open index.htmlOr double-click index.html in your file manager.
The frontend will open in your default web browser and connect to the backend API.