An open API service indexing awesome lists of open source software.

https://github.com/racoolstudio/ai-tic-tac-toe


https://github.com/racoolstudio/ai-tic-tac-toe

Last synced: about 1 year ago
JSON representation

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.