Skip to content

About

Tic Tac Toe game in python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Tic Tac Toe Game

A simple and interactive Tic Tac Toe game built with Python from scratch.

This was my first major project while learning Python. I built it without using AI tools (no Copilot) to strengthen my fundamentals.

Features

  • Clean and nice-looking game board
  • Player can choose to play as X or O
  • Input validation (prevents invalid moves and non-numeric input)
  • Proper win detection (rows, columns, and diagonals)
  • Automatic player switching
  • Announces the winner when the game ends

##UPDATE ON V2 -i have added computer opponent to play against and trust me, you will have a hard time against it.

How to Play

  1. Run the game using:
    python game.py
    Choose whether you want to play as X or O
  2. Enter a position number from 0 to 8 when prompted
  3. The game will automatically switch turns and check for a winner after every move

##Technologies Used

Python 3 Built using only basic Python (lists, functions, loops, conditionals)

What I Learned

  1. Working with lists and indexing
  2. Creating and using multiple functions
  3. Handling user input with validation
  4. Implementing game logic and win conditions
  5. Debugging and problem-solving step by step

##Future Improvements (Planned)

  1. Add option to play again after the game ends
  2. Detect and announce draws (ties)
  3. dd a simple computer AI opponent (Single Player mode)
  4. Improve code structure and remove global variables

##How to Run Bash# Clone the repository git clone https://github.com/latakin/tictactoe-python.git

Navigate to the project folder

cd tictactoe-python

Run the game

python game.py Author Lateef First Python project — Built with determination and no shortcuts.

About

Tic Tac Toe game in python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages