A full-stack Tic-Tac-Toe application with a React frontend and a FastAPI backend.
The AI uses the Alpha-Beta pruning algorithm to compute the optimal move.
This project demonstrates how classical AI algorithms can be used to solve deterministic games.
The backend implements the Alpha-Beta pruning algorithm, while the frontend provides an interactive interface for playing against the AI.
The application consists of two parts:
- Frontend: React application running in the browser
- Backend: FastAPI server that calculates the best move using Alpha-Beta pruning
AlphaBeta-tic-tac-toe-/ │ ├── backend/ │ └── main.py │ └── frontend/
Backend
- Python
- FastAPI
- Pydantic
Frontend
- React
- JavaScript
Algorithm
- Alpha-Beta pruning (Minimax optimization)
Open PowerShell or Command Prompt and run:
git clone https://github.com/NoMoreCookies/AlphaBeta-tic-tac-toe-.git
cd AlphaBeta-tic-tac-toe-
Navigate to the backend directory:
cd backendCreate a virtual environment:
python -m venv .venv
Activate the virtual environment.
.venv\Scripts\Activate
Start the backend server:
pip install fastapi uvicorn pydantic
python -m uvicorn main:app --reload
The backend server will run at:
cd AlphaBeta-tic-tac-toe-
cd frontend
Install dependencies:
npm install
npm start
