https://github.com/hetbhalani/tic-tac-toe
i made tic-tac-toe game using python
https://github.com/hetbhalani/tic-tac-toe
python
Last synced: 3 months ago
JSON representation
i made tic-tac-toe game using python
- Host: GitHub
- URL: https://github.com/hetbhalani/tic-tac-toe
- Owner: hetbhalani
- Created: 2024-11-15T14:46:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T14:23:36.000Z (over 1 year ago)
- Last Synced: 2025-01-18T05:29:38.246Z (over 1 year ago)
- Topics: python
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎮 Terminal-based Tic Tac Toe
A colorful, interactive two-player Tic Tac Toe game that runs in the terminal. Players can choose their symbols (X or O) and compete against each other in this classic game.
(fully made by me)
## 🌟 Features
- Colorful terminal interface using `termcolor`
- Two-player gameplay
- Custom player names
- Symbol choice (X or O)
- Game state tracking
- Win detection
- Draw detection
- Option to restart or exit the game
## 🚀 Installation
1. Clone this repository:
```bash
git clone https://github.com/hetbhalani/Tic-Tac-Toe.git
cd Tic-Tac-Toe
```
2. Install the required package:
```bash
pip install termcolor
```
## 🎯 How to Play
1. Run the game:
```bash
python main.py
```
2. Enter the names for Player 1 and Player 2
3. Player 1 chooses their symbol (X or O)
4. Players take turns entering numbers (0-8) to place their symbols on the board
5. Win by getting three symbols in a row (horizontally, vertically, or diagonally)
6. Choose to restart or exit after the game ends
## 🎲 Game Board Layout
The game board uses numbers 0-8 to represent positions:
```
0 | 1 | 2
———|———|———
3 | 4 | 5
———|———|———
6 | 7 | 8
```
## 🎨 Color Scheme
- Player O: Cyan
- Player X: Red
- Board lines: Magenta
- Available positions: Grey
## ⚙️ Requirements
- Python 3.x
- termcolor package
## 🤝 Contributing
Feel free to fork this project and submit pull requests. You can also open issues for bugs or feature suggestions.