- Nanodegree: Intro to Programming
- Module: Python
The project is a text based adventure game.
- Python
- Descriptions are printed to the console for the player to see.
- The
time.sleep
function is used to create delays between messages so that they aren't all printed at once. - The
random.choice
orrandom.randint
function is used to influence the game so that each game is different in some way. - The input function is used to ask the player what they would like to do.
- The player's choices affect what happens in the game, including:
- Whether the player wins or loses
- Whether to restart or exit after the game is over
- If the player enters a choice that is not valid, the game gives them the chance to retry until they enter a valid option.
- The game does not crash and does not treat invalid input as a valid choice.
- The code includes at least four function definitions that are used to improve the code in some way, such as by:
- Reducing repetition
- Reducing complexity
- Improving the readability or organization of the code
- Each function should have a single purpose and a name that describes that purpose.
- The
pycodestyle
tool reports zero errors and zero warnings. - The program is a playable game, and runs from start to finish without crashing or displaying errors.
- Clone project:
git clone https://github.com/Shaurav43/adventure_game.git
- Install dependencies:
- Pycodestyle: You can install, upgrade, and uninstall pycodestyle.py with these commands:
$ pip install pycodestyle
$ pip install --upgrade pycodestyle
$ pip uninstall pycodestyle
- Run project on terminal
python3 game.py
adventure game
is MIT licensed.