Skip to content

Project Description: Tic Tac Toe (Xs and Os) Tic Tac Toe, also known as Xs and Os, is a classic two-player game where players take turns marking spaces on a 3×3 grid. The goal is to align three of their marks (either "X" or "O") in a row, column, or diagonal before the opponent. If all spaces are filled without a winner, the game ends in a tie.

License

Notifications You must be signed in to change notification settings

Mahnoor-Muhammad-Naeem/Xs-and-Os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Project Description: Tic Tac Toe (Xs and Os) 🎮

Tic Tac Toe, also known as Xs and Os, is a classic two-player game where players take turns marking spaces on a 3×3 grid. The goal is to align three of their marks (either "X" or "O") in a row, column, or diagonal before the opponent. If all spaces are filled without a winner, the game ends in a tie.

This Python-based Tic Tac Toe game allows two players to play in the terminal. It features:

A simple command-line interface.

A turn-based system alternating between "X" and "O".

Input validation to prevent invalid moves.

A win-checking mechanism for rows, columns, and diagonals.

Description

Tic Tac Toe is a classic two-player game where players take turns marking "X" or "O" on a 3×3 grid. The first player to align three marks in a row, column, or diagonal wins. If all spaces are filled without a winner, the game ends in a tie.

However, This is a simple Python implementation of Tic Tac Toe, playable in the terminal.

Features

  • 🏆 Two-player mode (alternating turns for "X" and "O").
  • ✅ Input validation to prevent invalid moves.
  • 🏅 Automatic win detection.
  • 🔁 Continuous play until a winner is found or the game is tied.

How to Play

  1. Run the script using Python.
  2. Players take turns entering the row and column number (1-based index).
  3. The game board updates after each move.
  4. The game ends when a player wins or when all spaces are filled.

Installation

Clone this repository and run the script.

git clone https://github.com/Mahnoor-Muhammad-Naeem/Xs-and-Os.git
cd Xs-and-Os
python game.py

Usage

Start the game.

Enter the row and column number to place your mark.

Continue until a winner is declared or the game is tied.

Example Output

X | O | X

O | X | O

O | X | X

The winner was X

File Structure

📂 Xs-and-Os
 ├── game.py  # Main game logic
 ├── README.md  # Project documentation

License

This project is open-source and available under the MIT License.

This README provides a structured explanation for GitHub. Let me know if you need modifications! 🚀

About

Project Description: Tic Tac Toe (Xs and Os) Tic Tac Toe, also known as Xs and Os, is a classic two-player game where players take turns marking spaces on a 3×3 grid. The goal is to align three of their marks (either "X" or "O") in a row, column, or diagonal before the opponent. If all spaces are filled without a winner, the game ends in a tie.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages