Sep-24-2016, 10:52 PM
(Sep-24-2016, 10:35 PM)Yelmos Wrote:displayIntro() choice = choosePath() checkPath(choice) # choice is equal to "1" or "2" choice = choosePath2() checkPath2(choice) # choice is equal to "1" or "2" choice = choosePath3() checkPath3(choice) # choice is equal to "1" or "2" choice = choosePath4() checkPath4(choice) # choice is equal to "1" or "2" displayMed() choice = choosePath5() checkPath5(choice) # choice is equal to "1" or "2" or "3"
What I would do is put this section of code into a function and create a custom exception. Then instead of calling sys.exit(), you can raise your GameFailed exception and catch it inside your while loop. There are some other ways to solve this problem, but this one requires the least refactoring.
Running Manjaro Linux 16.08/OpenRC/i3wm on a Dell Precision 5510.
John 3:17
John 3:17