TTTgame-AR.py
is a Python script for a Tic-Tac-Toe game. The game allows two players to play Tic-Tac-Toe on a 3x3 board, with options for a player vs. computer mode.
I spent 1 hour and 30 minutes creating this code for the 'Tic-Tac-Toe' Challenge.
- Two-player mode or player vs. computer.
- Simple command-line interface.
- The game board displays as blank only when the user is the first one playing.
- The game board is displayed after each move.
- The game does not allow the user or computer to overwrite a previous mark.
- The game provides feedback if an invalid move is attempted, including out-of-range or already occupied positions.
- Checks for win, loss, or tie conditions when the board is full and no one has won.
- Offers the user the chance to play again.
- Handles exceptions.
- Python 3.x
-
Clone the repository:
git clone https://github.com/alycerios/Tic-Tac-Toe-challenge.git
-
Navigate to the Directory: cd Tic-Tac-Toe-challenge
-
Create a virtual environment to run the code python -m venv venv
-
Activating the virtual environment in Windows .\venv\Scripts\activate
-
Run the game: To run the game, execute the Python script: python TTTgame-AR.py (assuming
python
points to Python 3.x, if not use 'python 3').
As of now, there are no external libraries required for running this script.