Tic-Tac-Toe-with-Python

Text-Based Tic Tac Toe Game (Python)

A simple Tic Tac Toe game built with Python that runs directly in the command-line interface (CLI). This project demonstrates basic game logic, user interaction, and control flow in Python.


Overview

Tic Tac Toe is a classic two-player game where the goal is to get three of your marks (X or O) in a row, either horizontally, vertically, or diagonally.

This version is a text-based game that runs in the terminal, allowing two players to take turns and interact via the command line.


Features


Technologies Used


๐Ÿ“‚ Project Structure

. โ”œโ”€โ”€ main.py # Main Python file for the game โ””โ”€โ”€ README.md # Project documentation


Setup and Usage

Prerequisites

How to Run the Game

  1. Clone the repository: ```bash git clone https://github.com/yourusername/text-tic-tac-toe.git cd text-tic-tac-toe

    1. Run the game:

python main.py

๐ŸŽฎ How to Play 1. The game starts with Player X. 2. Players take turns by entering a number from 1 to 9, representing the positions on the board:

1 | 2 | 3

4 | 5 | 6 โ€”โ€”โ€” 7 | 8 | 9

3.	The game ends when:
โ€ข	A player gets three marks in a row (horizontally, vertically, or diagonally).
โ€ข	The board is full (itโ€™s a tie).
4.	The updated board is displayed after each move.

๐Ÿงฉ Code Explanation

The game uses a simple loop to handle user input and update the game board. It includes functions to: โ€ข Display the board โ€ข Check for a winner โ€ข Validate user input

๐Ÿ“œ License

This project is licensed under the MIT License. See the LICENSE file for more details.

๐Ÿ“ง Contact

If you have any questions or feedback, feel free to reach out on fay.abdillah@gmail.com

๐ŸŒŸ Show Your Support

If you like this project, please give it a โญ๏ธ on GitHub!