Print out a sentence or two describing the room that

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Print out a sentence or two: * describing the room that the player is in * stating that the player is standing in front of a treasure chest 9. Then... ask the player if they would like to: * 'open' the chest (also accept 'OPEN' and 'Open'), or .... * 'leave' it alone (also accept 'LEAVE' and 'Leave') 10. If they open the chest ... * generate a random number from 1 up-to and including 20 (use the random * module to do this) * if the number is 1 up-to and including 5, something bad happens * if the number is 6 up-to and including 10, nothing interesting happens * if the number is 11 up-to and including 15, something good happens * if the number is greater than 15, something great happens 11. If they choose to leave, display a message saying that nothing happens 12. If they don't enter either some permutation of 'leave' or 'open', scold them and end the game. __COMMENT YOUR SOURCE CODE__ by * briefly describing parts of your program * including your name, the date, and your class section at the top of your file (above these instructions) Example Output below (you can create your own outcomes). Anything that starts with > is user input: Example Run 1 (note the contents of the welcome message, and the result of entering Programmer as an occupation): ----- Hello adventurer, what is your name? > I_HAVE_A_LONG_NAME I_HAVE_A_LONG_NAME - are you a Warrior, Wizard or Programmer? > Programmer There is not treasure here for you. The real treasure is the time spent
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
programming.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern