https://github.com/racoolstudio/ai-tic-tac-toe
https://github.com/racoolstudio/ai-tic-tac-toe
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/racoolstudio/ai-tic-tac-toe
- Owner: racoolstudio
- Created: 2024-01-31T07:49:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T14:28:36.000Z (over 2 years ago)
- Last Synced: 2025-02-05T06:20:13.185Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI Tic Tac Toe
A basic implementation of Tic Tac Toe with an AI opponent.
## Code Structure
- `place(letter, location)`: Place 'x' or 'o' on the board.
- `ai()`: AI opponent makes a move.
- `isFilled()`: Check if the board is filled.
- `checkWinner()`: Check for a winner.
- `printBoard()`: Print the current state of the board.
## How to Run
Simply run the provided Python script:
```bash
python tic_tac_toe.py
```
## Link to Video : https://youtu.be/LUW0980_4ec
## How to Play
1. The board is represented as a 3x3 grid, and each cell is labeled with a number from 1 to 9.
2. Enter a number to place your 'x' on the corresponding cell. The AI will then make its move.
3. The game continues until there's a winner or the board is full.
## Outcome
- You Win if the player ('x') wins.
- AI Wins if the AI ('o') wins.