I created an object-oriented Python package for a number guessing game where the computer randomly chooses an integer and then tells a human player if a guess is higher or lower than the number and uploaded the package on PyPi.
The computer first welcomes the player asks the player for his name. In the next step, the computer asks the player if we would like to play a game: here the player can either answer Yes or No. The answer No closes down the game. If the player answers with yes, the computer asked the player if he wants to play the easy (number between 1-20) or the difficult (number between 1-30) version of the game. He also has again the possibility to quit the game.
Then the number guessing game starts where the computer randomly chooses an integer and then tells a human player if a guess is higher or lower than the number. If the player doesnt guess the number after 6 tries, the game will be terminated and the computer tells the player the number.
Install the packages by typing the following in the terminal
pip install number_guessing_game
import the package resp. the Game class to play the game
from number_guessing_game import Game
Start the game by calling the main-method from the class Game
Game.main()