2-3 Assignment_Mc

.docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

140 (20EW5

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by SargentOkapi3461

Report
1 6-3 Module Six Project Two I developed a text based game which requires the player to state their name and greets the player. Upon the greeting the player is given instructions on how the game will be played with what commands the player will be using such as the cardinal directions to move about the 9 rooms. Other interactions within the game will include prompts with not just how to move within the game but also what would the player like to do within the game. Questions such as “What would you like to do? This is followed by a set of options for the player; collect, move, or quit. With each option the player can either move within rooms, pick up items or leave the game. Any command or inputs that are not valid input are met with “Invalid input please try again.”
2 Within the programming I developed functions that tell the program how the information is organized and reusable to perform needed tasks such as in what is your name statement. I created dictionaries to hold the room’s parameters and items. I applied loops with else statements to denote if all else fails to let the player know what to do or they can go on within the game. I did function calling be defining a function first with how to move from room to room and how to collect items. I implement heavily on decision branching within this game to help navigate through the loops and what the parameters of inputs with if, elif and else statements. Throughout the building of the game, I debugged as much as possible to make sure all structures were correct or to help pick out problems. During this step I was able to place in the what ifs of invalid inputs. There are comments within the program for anyone that would like to adjust or upgrade the game. Questions: What should happen if the player enters a command move between rooms? The program validates information to see if command is a valid command and loops through options to pick what is being printing for player to choose. What should happen if the player enters a valid command to get an item from the room? Command for picking up items is collected, program validates command and appends list to add item to collected list for user to see all items collected so far.
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