Skip to content

old-ghost/tictactoe_rand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Tic-Tac-Toe Game

A simple command-line implementation of the classic Tic-Tac-Toe game where you play against the computer.

How to Play

  1. The game board is displayed as a 3x3 grid with numbers 1-9 representing available positions.
  2. You play as 'O' and the computer plays as 'X'.
  3. On your turn, enter the number corresponding to the position where you want to place your 'O'.
  4. The computer will automatically make its move as 'X' after your turn.
  5. The first player to get 3 of their marks in a row (horizontally, vertically, or diagonally) wins.
  6. If all positions are filled without a winner, the game ends in a tie.

Features

  • Clear visual representation of the game board
  • Input validation to ensure only valid moves are accepted
  • Random computer moves
  • Automatic detection of wins or ties

Requirements

  • Python 3.x

How to Run

  1. Save the game code to a file (e.g., tic_tac_toe.py)
  2. Run the game using Python:
py app.py

About

Tic-Tac-Toe with Random

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages