Skip to content

ERYXGF/tictactoe_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Tic Tac Toe — Python CLI Game

A fully interactive two-player Tic Tac Toe game running in the terminal, built in Python using functions and simple data types.

demo


✨ Features

  • Two-player mode (Player X vs Player O)
  • Live board display that updates after each move
  • Input validation — rejects invalid or already-taken squares
  • Automatic win detection for rows, columns and diagonals
  • Draw detection when the board is full
  • Play again prompt at the end of each game

🚀 Getting Started

Prerequisites

  • Python 3.8 or higher

Installation

git clone https://github.com/Faceless013/tictactoe_python.git cd tictactoe-python

Run the game

python main.py


🕹 How to Play

Players take turns entering a number from 1–9 corresponding to a position on the board:

1 | 2 | 3

4 | 5 | 6

7 | 8 | 9

The first player to get three in a row (horizontally, vertically or diagonally) wins. If all squares are filled with no winner, the game ends in a draw.


🛠 Built With

  • Python 3.11
  • Standard library only (no external dependencies)

📚 What I Learned

  • Structuring a project using simple functions
  • Handling and validating user input robustly
  • Using nested lists to represent a 2D game board
  • Writing clean game loop logic with clear win/draw conditions
  • Using different data types in conjunction with one another
  • How to use Github in general
  • Setting up a professional GitHub repository from scratch
  • Setting up Git for version control and creating a working Workspace on VS Code.

🗺 Future Improvements

  • Add a single-player mode with a basic AI opponent
  • Add score tracking across multiple rounds
  • Add colour to the terminal output using colorama
  • Build a simple GUI version using tkinter

📄 Licence

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

About

Interactive two-player Tic Tac Toe game built in Python with a CLI interface. This is the first milestone project from the Udemy Course "From Zero to Hero";

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages