This repository contains a simple Tic-Tac-Toe game where the user plays against the computer. The game is implemented in Python and is designed to be run from the command line. It features a basic computer opponent that attempts to block the user's winning moves and makes random moves otherwise.
To set up and run the Tic-Tac-Toe game, follow these steps:
-
Clone the Repository:
git clone https://github.com/OliviaLeavitt/tictactoechallenge.git
-
Navigate to the Project Directory:
cd tictactoechallenge
-
Install Dependencies:
Ensure you have Python installed, then install the required libraries with:
pip install -r requirements.txt
To start the game, use the following command:
```bash
python tictactoe.py
```
Follow the on-screen prompts to play the game. You will be asked to enter your move by specifying a row and column. The computer will make its move automatically.
- User vs. Computer: Play against a computer that attempts to block your winning moves and makes random moves otherwise.
- Console-based Interface: The game board and instructions are displayed in the terminal.
- The game board is displayed in the console.
- The computer's strategy includes blocking the user from winning and making random moves when no immediate threat is present.
- The game ends when there is a winner or the board is full.
Time spent on the challenge: 3 hours and 30 minutes.
-
Executable Version: A Windows executable version of the game is included as tictactoe.exe. You can run this executable directly without needing a Python interpreter.
-
Source Code: Complete source code and necessary files for running the program are included in the repository.
Thank you for reviewing my solution! If you have any questions or need further clarification, please feel free to reach out.
Olivia Leavitt
https://github.com/OliviaLeavitt