Question

Program 2: Buh-RING IT! For this assignment, youre going to simulate a text-based Role-Playing Game (RPG). Design (pseudocod

*************need in psuedocode please*************

0 0
Add a comment Improve this question Transcribed image text
Answer #1

// Pseudocode to simulate the battle between hero and monster using text-based role player game

Declaration
   number heroHP, monsterHP, heroDamage, monsterDamage;
   number damage, round;
  
Start
   // Input hero's starting hit points
   Input heroHP;
   // Input the damage the hero's weapon does per strike
   Input heroDamage;
   // Input the monster's starting hit points
   Input monsterHP;
   // Input the damage the monster's weapon does per strike
   Input monsterDamage;
  
   round = 1;
  
   // loop that continues till both hero and monster are alive i.e their HP > 0
   while(heroHP > 0 and monsterHP > 0)
   do
       print "Round ",round; // print the round number
      
       // generate a random number between 0 and heroDamage (inclusive)
       damage = random number between [0,heroDamage];
       print "Hero attacks for : ",damage;
      
       // damage the monster's hit points
       monsterHP = monsterHP - damage;
       print "Monster has ",monsterHP," left";
      
       // check if monster is dead, then exit from loop
       if monsterDamage <= 0 then
           exit from loop;
       end if;
      
      
       // generate a random number between 0 and monsterDamage (inclusive)
       damage = random number between [0,monsterDamage];
       print "Monster attacks you for : ",damage;
      
       // damage the hero's hit points
       heroHP = heroHP - damage;
       print "You have ",heroHP," left";
      
       round = round + 1;
   end while

   // determine who won
   if monsterHP <= 0 then
       print "The monster dies and you earns 5 XP";
   else
       print "You are dead";
   print "Battle ends....";  
End  

Add a comment
Know the answer?
Add Answer to:
*************need in psuedocode please************* Program 2: Buh-RING IT! For this assignment, you're going to simulate a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Summary task: C++ language; practice combining tools(functions, arrays, different kind of loops) to solve somewhat complex...

    Summary task: C++ language; practice combining tools(functions, arrays, different kind of loops) to solve somewhat complex problem. Description A Valiant Hero is about to go on a quest to defeat a Vile Monster. However, the Hero is also quite clever and wants to be prepared for the battle ahead. For this question, you will write a program that will simulate the results of the upcoming battle so as to help the hero make the proper preparations. Part 1 First, you...

  • Problem 5: Monster Factory (10 points) (Game Dev) Create a Monster class that maintains a count...

    Problem 5: Monster Factory (10 points) (Game Dev) Create a Monster class that maintains a count of all monsters instantiated and includes a static method that generates a new random monster object. In software engineering, a method that generates new instances of classes based on configuration information is called the Factory pattern. UML Class Diagram: Monster - name: String - health: int - strength: int - xp: int + spawn(type:String): Monster + constructor (name: String, health: int, strength: int, xp:...

  • HIGHEST SUBMISSION Vlew All Submissions Submission 17 Submitted on 6/10/2019 12 35 PM by Jenna Saleh...

    HIGHEST SUBMISSION Vlew All Submissions Submission 17 Submitted on 6/10/2019 12 35 PM by Jenna Saleh DESCRIPTION Objectives To write a classes based on sets of specifications To write a main class to be used in a multi-class Java program To use inheritance to extend a class (optional, EC) To override methods in subclasses (optional, EC) Groups You may work with a partner on this assignment. A header comment (In every Java file) should include authors (group members) and collaborators...

  • Question 1. (Magician.java, Healer.java, Fighter.java, HeroTester.java) Consider the abstract hero class and the three subclasses shown...

    Question 1. (Magician.java, Healer.java, Fighter.java, HeroTester.java) Consider the abstract hero class and the three subclasses shown below. Review the hero class to see how it works (it’s in the project/package for you already). Your job is to implement the following subclasses. Each of the subclasses has an extra data field that relates to their specific hero talent. Some help with these special talents and other methods are below. Fighter: ‐The fighter has an extra data field called Strength and a...

  • WRITE IN LANGUAGE C. THANKS Heroic Game Write a program that plays a simple game. Mostly...

    WRITE IN LANGUAGE C. THANKS Heroic Game Write a program that plays a simple game. Mostly the purpose of the program is to practice using structs. Here is a struct that contains information about a character in the game: typedef struct {   int hitPoints;    /* how much life */   int strength;     /* fighting strength */   char name[MAXNAME]; } Hero; The same structure is used for all characters (even non-heroic.) First write the function void printHero( Hero hr )that prints a...

  • First, you will need to create the Creature class. Creatures have 2 member variables: a name,...

    First, you will need to create the Creature class. Creatures have 2 member variables: a name, and the number of gold coins that they are carrying. Write a constructor, getter functions for each member, and 2 other functions: - void addGoldCoins(int) adds gold coins to the Creature. - void identify() prints the Creature information. The following should run in main: Creature d{"dragon", 50}; d.addGoldCoins(10); d.identify(); // This prints: The dragon is carrying 60 gold coins. Second, you are going to...

  • Please, I need help with program c++. This is a chutes and ladders program. The code...

    Please, I need help with program c++. This is a chutes and ladders program. The code must be a novel code to the specifications of the problem statement. Thank you very much. Assignment Overview This program will implement a variation of the game “chutes and ladders” or “snakes and ladders:” https://en.wikipedia.org/wiki/Snakes_and_Ladders#Gameplay. Just like in the original game, landing on certain squares will jump the player ahead or behind. In this case, you are trying to reach to bottom of the...

  • I am having an issue adding in the following strenght and defense criteria. *Mob, *charm, *Hogwarts....

    I am having an issue adding in the following strenght and defense criteria. *Mob, *charm, *Hogwarts. Can you help please? Requirements In this project, you will create a simple class hierarchy as the basis for a fantasy combat game. Your ‘universe’ contains Vampires, Barbarians, Blue Men, Medusa and Harry Potter. Each has characteristics for attack, defense, armor, and strength points as follows. Type Attack Defense Armor Strength Points Vampire1 1d12 1d6* Charm 1 18 Barbarian2    2d6 2d6 0 12 Blue...

  • Hello, There are some elements in my code that aren't working properly that need to be...

    Hello, There are some elements in my code that aren't working properly that need to be fixed but I don't know what I have done wrong. The printHealthBars() should print out a '+' for each point of current health and a '-' for each difference between current & max health. So, for instance, suppose the pokemon had 6/8 health, the method should print: "[ ++++++-- ]" Something is up with the damage calculation method. The idea is that it should...

  • I need a basic program in C to modify my program with the following instructions: Create...

    I need a basic program in C to modify my program with the following instructions: Create a program in C that will: Add an option 4 to your menu for "Play Bingo" -read in a bingo call (e,g, B6, I17, G57, G65) -checks to see if the bingo call read in is valid (i.e., G65 is not valid) -marks all the boards that have the bingo call -checks to see if there is a winner, for our purposes winning means...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT