This is a simple script for a two-player game of tic-tac-toe.
Python 3.0 or any higher version
- Clone the repository
git clone https://github.com/olczi095/tic-tac-toe.git
- Change the directory
cd tic-tac-toe
- Run the code
python tic_tac_toe.py
At the beggining of the game, you will be asked to enter the names of two players. Player 1 will have the 'X' sign and Player 2 will have the 'O' sign.
The cells of the board are numbered from 1 to 9, forming as a 3x3 grid. Players take turns to enter the number of the cell they wish to fill with their assigned sign.
The game ends when one player gets three of their signs in a row - horizontally, vertically or diagonally or when all cells are filled and the game ends with a tie.
At the end of the game, players can choose to play again or exit the game.