Educational goals of this lab - verify that every student can
Submit your file Lab4.py using the Canvas submit link.
INSTRUCTIONS:
Sample run
You wake up on the beach of a desert island. You see the beach stretching to the north and some trees inland. Do you 1. walk along the beach 2. go inland > 2 You see a monkey next to a tree. Do you 1. wrestle with the monkey 2. say hello? > 1 You win the match with the monkey! He gives you a coconut! Adventure over! Results: Congratulations! you got out of the game alive! You have a coconut
Another sample run
You wake up on the beach of a desert island. You see the beach stretching to the north and some trees inland Do you 1. walk along the beach 2. go inland > 1 you see a chest half buried in the sand! Do you 1. open the chest 2. pick up the chest? > 2 Sorry! the chest is too heavy, you die! Adventure over! Results: You didn't make it
Your program MUST output "Adventure over!" and then tell the outcome of the game. You can only have one print statement that says "Adventure over!". The outputs at the end of the game are:
Results:
If you died in the game, the gold or the coconut is NOT mentioned.
(16 points) Test Plan
Test Case # | Description | Input Choices | Expected Outcome | |
---|---|---|---|---|
First | Second | assumes "Adventure over!" in every case | ||
1 | Walks on the beach, open chest | 1 | 1 | You find 500 gold doubloons, Congratulations, you got through the game alive! You have gold |
2 | A. | 1 | 2 | B. |
3 | C. | 2 | D. | E. |
4 | F. | 2 | G. | H. |
(20 points) Design
Team x, section x, Members purpose - to take the user on an adventure Pre-conditions: user inputs choices as integers, 1 or 2. Post-conditions: prompts are displayed, results of actions are displayed outcome of game is reported # set gold flag to False # set coconut flag to False # set lived flag to True # display first prompt # get user's first choice # if user chooses 1 # display chest prompt Open / Carry # get user's second choice
(49 points) Implementation
Submit your Python file (lab4.py) using the Canvas link.