Question
USING THE LATEST PYTHON 3.62 2017 Source Code import random import time def displayIntro(): print('You are in a land full of dragons. In front of
USING THE LATEST PYTHON 3.62 2017
Source Code
import random import time
def displayIntro(): print('You are in a land full of dragons. In front of you,') print('you see two caves. In one cave, the dragon is friendly') print('and will share his treasure with you. The other dragon') print('is greedy and hungry, and will eat you on sight.') print()
def chooseCave(): cave = '' while cave != '1' and cave != '2': print('Which cave will you go into? (1 or 2)') cave = input()
return cave
def checkCave(chosenCave): print('You approach the cave...') time.sleep(2) print('It is dark and spooky...') time.sleep(2) print('A large dragon jumps out in front of you! He opens his jaws and...') print() time.sleep(2)
friendlyCave = random.randint(1, 2)
if chosenCave == str(friendlyCave): print('Gives you his treasure!') else: print('Gobbles you down in one bite!')
playAgain = 'yes' while playAgain == 'yes' or playAgain == 'y':
displayIntro()
caveNumber = chooseCave()
checkCave(caveNumber)
print('Do you want to play again? (yes or no)') playAgain = input()
Get the Dragon.py code by downloading the file from the online book link.
Get it to run for you. Test it out and see how it works.
Based on the Dragon.py program create your own text adventure game:
All Design notes, choices and flowchart should be completed in documentation.
Create a Simple Design Document that contains your game title, description, diagram, flowchart and testing options -- see attached template.
Show that you planned the game in your notebook
Your program will have at least 10 caves/areas/choices total
Draw a labelled diagram of your area choices -- make sure all choices are annotated
Create a detailed description of your overall game including a name and Objective
Create an overall flowchart for your game
Code your text adventure game in python with replay game loop
Take multiple screenshots of running program
Test your game for various scenarios -- list your testing option -- play testing is allowable.
Extra Credit -- Create additional choices over 10 and the amount of randomness in the game
Once you have your text adventure game tested, Upload your code(*.py file), and design document to prove you completed the assignment.
Document for proof
Adventure Game Title:
Game Description:
Game Objective:
Cave Diagram:
Game Design Flowchart:
Game Testing Strategies:
Screenshots of Working Program:
Game Source Listing:
Thank you.
Python 3.4.1: dragon realm.py -NAdragon realm-py File Edit Format Run Options Windows Help import random import time LePython 3.4.1 Shell File Edit Shell Debug Options Windows Help Python 3.4.1 (V3.4.1:c0e311e010fc, May 18 201, 10:38:22) [MSC v.1600 32 bit tel) on win32 Type "copyright" "credits" or "license)" for more information def displayIntro) RESTART print("You are in a land full of dragons In front of you,") print ("you see two caves. In one cave, the dragon is friendlY") print(and will share his treasure with you. The other dragon") print("is greedy and hungry, and will eat you on sight.") print ) You are in a land full of dragons. In front of you, you see two caves. In one cave, the dragon is friendly and will share his treasure with you. The other dragon is greedy and hungry, and will eat you on sight. def chooseCave ) Which cave will you go into? 1 or 2? cave -R while cave-1"and cave -2" print ("Which cave wi11 you go into? o 2?") cave = input () You approach the cave It is dark and spooky.. . A large dragon iumps out in front of you! He opens his jaws and... return cave gives you his treasure! def checkCave (chosenCave): Do you want to play again? (es o No) print("You approach the cave. ..") time.sleep (2) print ("It 1s dark and spooky...") time.sleep (2) print ("A large dragon jumps out in front of you! He opens his jaws and...") print) time.sleep (2) EriendlyCaverandom. randint (1,2) 11 chosencave == str (friendlyCave): else: print ("gives you his treasure!") print("gobbles you down in one bite!") playAgain -"yes' while playAgain "yes" oz playAgain - "y: dieplayintro ) caveNumber-chooseCave (0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started