Skip to content

This is udacity nanodegree program in which I created an adventure game in python

Notifications You must be signed in to change notification settings

gursparsh/adventure-game-in-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

adventure-game-in-python

This is udacity nanodegree program in which I created an adventure game in python In this I created an adventure game using python This is a simple game and made it more easy to read by usinf functions and calling them whenever required. My code meets followinf specifications:- Code Review The descriptions are printed to the console for the player to see.

The game uses the following functions:

The time.sleep function is used to create delays between messages so that they aren't all printed at once. The random.choice or random.randint function is used to influence the game so that each game is different in some way. The game uses the input function in combination with conditional statements (e.g., if and while) to create an interactive program.

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. The game uses a conditional loop to handle invalid input. 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 program's code is refactored by defining and calling functions. 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 code written follows the standard Python Style Guide, such that 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.

About

This is udacity nanodegree program in which I created an adventure game in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages