Skip to content

This repository contains a simple, console-based Tic Tac Toe game implemented in Python. It offers both Player vs Player and Player vs Bot modes. The project demonstrates basic Python programming concepts, including functions, loops, and conditional statements.

Notifications You must be signed in to change notification settings

Fantonos/Tick-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Tic Tac Toe

This is a simple command-line Tic Tac Toe game implemented in Python. The game supports two modes: Player vs Player and Player vs Bot.

Features

  • Two game modes: Player vs Player and Player vs Bot
  • Interactive command-line interface
  • Randomized bot moves
  • Help section for game instructions
  • Win condition checking

How to Play

  1. Run the script using Python:

  2. Choose the game mode:

  • Enter 1 for Player vs Player
  • Enter 2 for Player vs Bot
  1. Players take turns entering their moves using the coordinate system:
        (1)  (2)  (3)
    A) | A1 | A2 | A3 |
    B) | B1 | B2 | B3 |
    C) | C1 | C2 | C3 |
  1. Enter the coordinates (e.g., A1, B2, C3) to place your symbol on the board.

  2. The game continues until a player wins or the game ends in a tie.

Help

You can access the help section at any time by typing HELP, H, HE, or HEL when prompted for input.

Game Logic

  • The game board is represented by a dictionary tic_tac_dic.
  • Players use symbols 'X' and 'O'.
  • The check_if_won function checks for winning conditions after each move.
  • In Player vs Bot mode, the bot makes random moves using the bots_move function.

Functions

  • get_player_input: Handles player input and updates the game board
  • display_game_board: Prints the current state of the game board
  • bots_move: Generates a random move for the bot
  • help_section: Displays game instructions
  • check_if_won: Checks if the current player has won
  • main: Main game loop
  • start: Initiates the game and handles game mode selection

Requirements

  • Python 3.x

License

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

Creative Commons Zero v1.0 Universal

About

This repository contains a simple, console-based Tic Tac Toe game implemented in Python. It offers both Player vs Player and Player vs Bot modes. The project demonstrates basic Python programming concepts, including functions, loops, and conditional statements.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages