TextBased Adventure Game 1
TextBased Adventure Game One:
from random import randint
import time
def displayintro():
print("Line 1: Its just for the introduction about this project")
print("This is the textbased adventure mini game")
print("Here user have 2 options to select option 1 or option 2")
print()
def choosepath():
path = ""
while path != "1" and path != "2":
path = input("Which path will you choose? ('1' or '2'): ")
return path
def checkpath(choosepath):
print(choosepath)
print("You have done with path")
time.sleep(2)
print("Welcome to the world of Dreams ")
time.sleep(2)
print("World of Art is a long established series of art books from the publisher Thames & Hudson, now comprising over 150 titles.")
time.sleep(2)
correctpath = randint(1,2)
print("random value is: ",correctpath)
if choosepath == str(correctpath):
print("Now you are going to WORLD OF ART...")
print("Welcome HOME!")
else:
print("Input not matched with random value")
playagain = "yes"
while playagain == "yes" or playagain == "y":
displayintro()
choice = choosepath()
checkpath(choice) #choice is equal to '1' or '2'
playagain = input("Do you want to play again???")
Comments
Post a Comment