Skip to content

A Python implementation of the classic Tic-Tac-Toe game. Play against a computer with basic blocking strategy.

Notifications You must be signed in to change notification settings

OliviaLeavitt/tictactoechallenge

Repository files navigation

Tic-Tac-Toe Challenge

Overview

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.

Installation

To set up and run the Tic-Tac-Toe game, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/OliviaLeavitt/tictactoechallenge.git
  2. Navigate to the Project Directory:

    cd tictactoechallenge
  3. Install Dependencies:

    Ensure you have Python installed, then install the required libraries with:

    pip install -r requirements.txt

Usage

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.

Features

  • 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.

Notes

  • 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

Time spent on the challenge: 3 hours and 30 minutes.

Distribution

  • 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.

Contact

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

About

A Python implementation of the classic Tic-Tac-Toe game. Play against a computer with basic blocking strategy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages