https://github.com/ishtms/tic-tac-toe-py
https://github.com/ishtms/tic-tac-toe-py
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ishtms/tic-tac-toe-py
- Owner: ishtms
- License: mit
- Created: 2018-07-17T06:08:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T06:11:06.000Z (almost 7 years ago)
- Last Synced: 2025-02-28T14:05:16.547Z (3 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Demo
``` python
>>> import TicTacToeMaster as ttt>>> board, nextMove = ttt.getRandomBoard()
>>> ttt.printBoard(board)
>>>
_ _ _
O X _
O O X>>> bestMove = ttt.getAIMove(board, nextMove, nextMove)
>>> print(nextMove+" should play at: " + str(bestMove[0]) + " index")
>>>
X should play at: 0 index>>> board = [" ", " ", "X", " ", "O", " ", "X", " ", " "]
>>> bestMovePosition = ttt.getAIMove(board, "O", "O")[0]
>>> print("O should play at: " + str(bestMovePosition) + " index")
>>>
O should play at: 1 index```
## Installation
Just Copy the TicTacToeMaster.py in your project and you are good to go
## Dependencies
None, pure python code.