diff --git a/.vs/Git Repository/v16/.suo b/.vs/Git Repository/v16/.suo new file mode 100644 index 0000000..f542431 Binary files /dev/null and b/.vs/Git Repository/v16/.suo differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..56ed55c Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/InteractiveStoryPythonConversionProject/.vs/InteractiveStoryPythonConversionProject/v16/.suo b/InteractiveStoryPythonConversionProject/.vs/InteractiveStoryPythonConversionProject/v16/.suo new file mode 100644 index 0000000..a689231 Binary files /dev/null and b/InteractiveStoryPythonConversionProject/.vs/InteractiveStoryPythonConversionProject/v16/.suo differ diff --git a/InteractiveStoryPythonConversionProject/InteractiveStoryPythonConversionProject.py b/InteractiveStoryPythonConversionProject/InteractiveStoryPythonConversionProject.py index a056236..6ba59b9 100644 --- a/InteractiveStoryPythonConversionProject/InteractiveStoryPythonConversionProject.py +++ b/InteractiveStoryPythonConversionProject/InteractiveStoryPythonConversionProject.py @@ -1,33 +1,28 @@ - -#Module formatting into story dictionary, 0:text where 0 is the index number of the module and text is the text of the module. \n=linebreak -story={0:"You are reading a magazine. The phone rings.\n (1)continue reading the magazine and ignore the call \n (2)Inspect the room \n (3)you pick up the phone", 1:"[{You pick up the phone section}]", 2:"hi", 3:"OOOP", 4: "AAAAAA"} -y = 0 -moduleProgressList = [] - -while True: - if y > -1: - 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 - 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) - y = choiceNumber #y is the target module as chosen by the user input - else: - while y != int or ( y < 0): - 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) - y = choiceNumber #This ensures that only valid numbers - - - - +#Module formatting into story dictionary, 0:text where 0 is the index number of the module and text is the text of the module. \n=linebreak +story={0:"You are reading a magazine. The phone rings.\n (1)Continue reading the magazine and ignore the call \n (2)Inspect the room \n (3)You pick up the phone", 1:"[{You pick up the phone section}]", 2:"hi", 3:"OOOP", 4: "AAAAAA"} +y = 0 +moduleProgressList = [] + +while True: + if y > -1: + 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 + 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) + y = choiceNumber #y is the target module as chosen by the user input + else: + while y != int or ( y < 0): + 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) + y = choiceNumber #This ensures that only valid numbers \ No newline at end of file