Code Monkey home page Code Monkey logo

two-player-tic-tac-toe's Introduction

Two-Player-Tic-Tac-Toe

This is a simple command-line implementation of the popular game Tic-Tac-Toe written in Python. It allows two players to play the game on the same computer.

How to play

1.Clone or download the repository to your computer.

  1. Open the terminal and navigate to the project directory.

  2. Run the game by executing the command python 2-players-tic-tac-toe.py

  3. The game board will be displayed on the screen, and it will be empty at the start of the game.

  4. Player 1 will be prompted to make their move by entering a number between 1 and 9, where each number corresponds to a space on the board.

  5. After player 1 makes their move, the board will be updated and displayed again.

  6. Player 2 will then be prompted to make their move, following the same process as player 1.

  7. The game will continue until either a player gets three of their symbols in a row, horizontally, vertically, or diagonally or the board is filled and no one wins the game. The game will be a draw in this case.

  8. If a player tries to place their symbol on a space that is already taken, the player will be prompted to choose again.

Winning

The first player to get three of their symbols in a row wins the game.

Draw

If the grid is completely filled, and no player has achieved three symbols in a row, the game is a draw.

Restarting

To restart the game, you can just run the script again.

Requirements

Python 3

Enjoy the Game!

This is a simple implementation of Tic-Tac-Toe game, Feel free to fork and make changes to the code to improve the game.

two-player-tic-tac-toe's People

Contributors

abhiseksarkar2001 avatar

Stargazers

Ayan Sahoo avatar

Watchers

 avatar

Forkers

ayans13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.