Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mreliptik/tictactoe-ai
A tic tac toe game with a minimax AI implementation
https://github.com/mreliptik/tictactoe-ai
ai minimax python3 tictactoe
Last synced: 2 months ago
JSON representation
A tic tac toe game with a minimax AI implementation
- Host: GitHub
- URL: https://github.com/mreliptik/tictactoe-ai
- Owner: MrEliptik
- License: mit
- Created: 2018-12-07T13:46:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T21:35:46.000Z (over 2 years ago)
- Last Synced: 2023-03-03T00:08:21.444Z (almost 2 years ago)
- Topics: ai, minimax, python3, tictactoe
- Language: Python
- Homepage:
- Size: 98.6 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TicTacToe-AI
A tic tac toe game with a minmax algorithm implementation.
## How to play?
Simply type `python game.py` in a terminal and you're good to go!
You play the cross and the AI plays the circle.
## Minimax algorithm
The AI agent is using a minimax algorithm to make its move. Follow [this link](https://en.wikipedia.org/wiki/Minimax) for the wikipedia article on this algorithm.
Basically, the algorithm works because we are in a *zero-sum game*, which means that every state of the game is visible to all the players. Becauser of that, the agent can explore all the possible outcome at a given state and evaluate which move to make to *minimize* its chance of losing.
Because the agent always tries to minimize its loss, you'll often make a draw with it.
## Dependencies
Simply type:
pip install -r requirements.txt
or see the following:
- pygame==1.9.4
- numpy==1.15.4