Skip to content

A game where the player guesses a randomly generated number in a given range, within a certain number of tries

License

Notifications You must be signed in to change notification settings

Andy-Wu12/Guess-The-Number

Repository files navigation

Guess-The-Number picture picture

A command-line game where the player has to guess a randomly generated number in a given range with limited tries.

Features

Play game

  • Start a new game on the currently set difficulty level (default 'easy').

Difficulty levels (easy, medium, hard)

  • A higher difficulty increases the range that the generated number falls into, while you only get a slight increase to your number of guesses.

Statistics History

  • View various statistics regarding your game history such as number of wins and losses, guesses, etc.

Simulate optimal playthroughs

  • Choose your own range for the generated number and get visual feedback for how the computer plays.

Save / Load statistics

  • Save your statistics before quitting so that you can load them in the next time the program is started.
  • Saves are made automatically after every game played, so manually saving is not entirely necessary.
    • Manually saving before loading your file on startup can be a way to reset your progress, should you choose to do so.

Dependencies

  • You will need at least Python 3.7 to run this program.
  • If you want to create and / or run tests, you will also need the pytest module.
    • You can install it via command-line with pip3 install -U pytest

How to run

  1. Download the game.py file onto your machine.
  2. cd into the directory where the file was downloaded.
  3. Run the command python3 game.py

About

A game where the player guesses a randomly generated number in a given range, within a certain number of tries

Topics

Resources

License

Stars

Watchers

Forks

Languages