Skip to content
Permalink
40000dfb2f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (44 sloc) 2.38 KB
from dictionary import *
y = 0
moduleProgressList = []
condition = True
while True:
condition = True
while condition == True:
if y > -1 and y < 61:
moduleProgressList.append(y) #Adds the current module to the list of travelled modules
text = story[y]
print(text) #Displays module text based on y value recieved
if y==50 or y==60 or y==59 or y==48 or y==52 or y==47:
condition = False #prevents user from accessing a different part once they have reached an endin
else:
x = input("Your choice is...")
if x.isdigit() == False: #This determines whether the value input is a digit
while x.isdigit() ==False:
print("This is an invalid input")
x = input("Your choice is...")
choiceNumber = int(x)
previous = y
y = choiceNumber #y is the target module as chosen by the user input
if y == 24:
hold = str(previous)
else:
while y != int or ( y < 0) or y > 60:
print("This is an invalid input")
x = input("Your choice is...")
if x.isdigit() == False:
while x.isdigit() ==False:
print("This is an invalid input")
x = input("Your choice is...")
choiceNumber = int(x)
previous = y
y = choiceNumber #This ensures that only valid numbers
if y == 24:
hold = previous #holds the location prior to moving into the runaway side branch so that the page they would return to is displayed on the screen when they go back
x = input("The End would you like to play again? y/n")
if x != "y" and x != "Y" and x!= "n" and x!= "N": #This determines whether the value input is a digit
while x != "y" and x != "Y" and x!= "n" and x!= "N":
print("This is an invalid input")
x = input("Your choice is...")
if x == "n" or "N":
break # breaks the while true loop if players dont want to restart