Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment Specifications

For this assignment you will write a simple text adventure game. Within this game the player will travel from room to room choosing which door to traverse through. Once through a door the player cannot go back through the door that she came through.

Game Specifications

Every room in the game has 4 doors for the player to choose from, each associated with an uppercase direction: N, E, S or W. Three of the doors open up to another room, and the 4th door is an exit from the game. Of the three non-exit doors, one will send the player to a room containing a monster. Another will send the player to a room containing a genie. The third non-exit door will send the player to a room that has a picture.

The player will begin the game holding two types of items, bananas and oranges. The player should start out with 5 bananas and 3 oranges.
For simplicity. There are two possible alignments of the 4 doors. At the beginning of each turn this random alignment is decided. For clarification on implementation we will refer to these alignments as 0 and 1.

Alignment 0
N: Monster
S: Genie
E: Picture
W: Exit
Alignment 1
N: Exit
S: Monster
E: Genie
W: Picture

IMPORTANT: Only 1 random alignment is chosen per turn. If the user does not enter a valid directional door choice (N/E/S/W), keep asking for a direction but DO NOT get a new random alignment value.

Door Actions

The game should ask the player to choose a door to step into. If the player steps into a room with the monster inside, the monster will steal all of the bananas and oranges the player is holding.

If the player steps into the room with the genie inside, the genie will give the player 2 additional bananas and 1 additional orange. If the player steps into the room with the picture inside, the game should just draw the picture to the screen but no other reward is granted. Finally, if the player steps through the door to the exit, the game should end. When the game ends, give the player her combined and individual scores. The combined score is the total number of bananas and oranges the player is holding when finding the exit.

Functions

You must write a function for each door. When the player chooses a door in a certain direction (N/E/S/W) -- and only one of those values -- the program should call the function for the door in that direction or end the program if she chooses the door to the exit. Some of these functions will use reference variables for all or some of their parameters.

You MUST use these function names and use the specified number and types of parameters for each function. Here is what each function must do:

? monsterRoom: Returns nothing; takes two integers both by reference and a string by value.

The function reduces the values of the variables storing the number of bananas and oranges to 0. This function should also tell the player what monster attacked them.

? genieRoom: Returns nothing; takes two integers both by reference (number of bananas and oranges, respectively). Increase the values of the variables storing the number of bananas and oranges by the appropriate number as per the game specification. The function should also output the message telling the player what she encountered in the room and what happened.

? pictureRoom: Takes no parameters and returns nothing. This function must output the proper announcement and draw a picture to the screen. We have provided a drawPicture function for your pictureRoom function to call; the provided function actually does the picture drawing. Your function should also tell the player what happened.

The drawPicture function is HERE, you should copy and paste it prior to the pictureRoom function call then invoke it as part of the pictureRoom implementation

Implementation Hints

? You will need variables to store the number of bananas and oranges.
? Follow every input operation by outputting a blank line utilizing a separate output operation.
? Some of the functions will use reference variables for all or some of their parameters.
? DO NOT use global variables
? Before the adventure begins, ask the user for their name and the scariest monster they can think of, storing each as a string. You will pass the monster name to the associated function when the monster attacks the player.

Testing Specifications

As with all games we wish them to be as unpredictable as possible. However, when testing to verify the program is in working condition we must have a measure of predictability. To achieve similar results to the ones shown within the input and output samples you should utilize a random seed value of 500 (srand(500);). This is for testing purposes only! You should maintain the unpredictability on turn-in and submit with with srand(time(0)) as the seed call.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92027720
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Many high school students take the ap tests in different

Many high school students take the AP tests in different subject areas. In 2007, of the 144,796 students who took the biology exam 84,199 of them were female. In that same year, of the 211,693 students who took the calcu ...

Question is it ethical for a potential employer to use the

Question: Is it ethical for a potential employer to use the Internet this way? Is it legal? What if an angry ex-boyfriend or ex-girlfriend posted some things, pretending to be you? How might this affect your chances for ...

Question need to discuss on issues and security

Question: Need to discuss on issues and security vulnerabilities caused by using 4 digit pin while accessing Banking. 1) Abstract 2) Acknowledgement 3) List of Abbreviations 4) Table of contents 5) List of tables 6) List ...

Is it ethical for facebook to mine its users posts for

Is it ethical for Facebook to mine its users' posts for signals that those users are about to go through a break up? Is it ethical for the company to then help its clients target their ads based on this research? Is what ...

You have a deck of magic the gathering cards with 60 cards

You have a deck of Magic the Gathering cards with 60 cards total. In the deck you have 20 Mana cards, 18 Spells, 3 Artifacts, 12 Creatures, 6 Enchantments and 1 Planes Walker. What is the probability that you draw 2 arti ...

How to solve this question by using r languageyou can

How to solve this question by using R Language? You can attach the Boston data set in the MASS package. library(MASS) For the Boston data set, we are interested in predicting whether a given suburb has a crime rate above ...

A population has a mean72 and a standard deviation sigma28

A population has a mean=72 and a standard deviation σ=28. Find the mean and standard deviation of a sampling distribution of sample means with sample size n=49.

Explain a business process you are familiar with describe

Explain a business process you are familiar with. Describe how a computer-based information system is related (or used) in this business process. Explain how a computer-based information systems can improve the efficienc ...

Requirementsnew payroll functionality to allow global

Requirements New payroll functionality to allow global employee to submit banking information to get paid electronically (i.e. direct deposit paycheck to bank account). Initial pilot has 3 countries in Asia Pacific, Euro ...

Really needing some help with this assignmentto convert

Really needing some help with this assignment. To convert degrees Celsius to degrees Kelvin, we simply add 273 (°K= °C + 273). Prompt the user for a temperature in degrees Celsius, then convert that temperature to degree ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As