This project is a command-line implementation of Tic-Tac-Toe where a user can play against a Reinforcement Learning (RL) agent. The agent is trained using the Q-learning algorithm. The project also allows for training the AI agents and watching them play against each other.
- Play Tic-Tac-Toe against an AI.
- Train the AI through self-play.
- Watch two AI agents play against each other.
- Command-line interface.
- Ensure you have Python 3.12+ and
poetryinstalled. - Clone the repository:
git clone https://github.com/your-username/rl-tic-tac-toe.git
- Install dependencies:
poetry install
To start the interactive game menu, run:
poetry run python src/rl_tic_tac_toe/main.pyFrom the menu, you can choose to:
- Train the AI agents.
- Play against a trained AI.
- Watch two AI agents play against each other.
To execute the test suite, run:
poetry run pytestThis project uses Ruff for code formatting and linting. To check the code for style issues, run:
poetry run ruff check .This project uses MyPy for static type checking. To check for type errors, run:
poetry run mypy .