ModuleSixMilestone Document

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

140

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

3

Uploaded by ElderScienceSwan36

Report
# Simplified Dragon Text Game by Claudia Resendez # Exciting Industry Standard Start Mes print("Welcome to the World of Dragon where Death can creep up on you out of nowhere! Are you ready for the journey?!") print("Prepare for a trip filled with magic.") print("Your mission, if you accept, is to navigate through magical rooms") print("Are you ready for this mind blowing challenge that will alter your life?") # A dictionary that defines the rooms in the game and their connections. rooms = { 'Great Hall': {'South': 'Bedroom'}, 'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'}, 'Cellar': {'West': 'Bedroom'} } # The player begins the game in the Great Hall. currentRoom = 'Great Hall' # Game looping journey is starting here. while True: # Display the player's current location. print("\nYour Adventurous Trip has Led You to the Magical Realm of the
{}".format(currentRoom)) # Prompt the player to enter a move (e.g., 'go direction' or 'exit'). move = input("Where would you like to go next? Enter your direction:").split()[-1].capitalize() print('------------') # The instructions on how to exit the game. if move == 'Exit': # Magical Exit Message print("Good job on your magical trip thus far!") print("You've successfully passed all challenges!! Now you can go back to where you came from.") print("Your trip is going to make history!!!") break # The player's move is valid. elif move in rooms[currentRoom]: # Update the player's current room to the expected direction. currentRoom = rooms[currentRoom][move] # The player's move is invalid. else: print('Oh No! That is not a valid direction!! Try choosing a different way, comrad!')
My explanation: In Python I created a text-based game called the “Magical Dragon Adventure Game”. I started the game that gets the player excited with the introduction by saying the game is magical. The player has a mission and that is to explore different rooms that are connected by a dictionary which explains their relationships. My game has a loop that controls the programs’ flow. This loop will have the game continue unless the player uses the word “Exit”. My code has decision branching that controls the programs flow that checks the validity of the player’s move. When the player exits the game, they get an exit message that congrats them. I have input validation on my code. This makes sure that the player’s input is processed correctly. This allows the “exit’ option and the “go direction” to work properly. I debugged my code, and I didn’t get any errors. If the player enters any other move besides direction or exit, they will get an invalid message and prompted to enter a valid answer. The code follows good industry best standards. It has messages that engage with the player that try to make it a fun experience for them. The game’s structure used industry-standard best practice for making text-based games using Python. I think my code meets the requirements because it is an exciting game, and it is simple and readable like the industry’s best standards.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help