diff options
| -rw-r--r-- | gamelib.py | 8 | ||||
| -rw-r--r-- | guessnum.py | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/gamelib.py b/gamelib.py new file mode 100644 index 0000000..8728194 --- /dev/null +++ b/gamelib.py @@ -0,0 +1,8 @@ +def winending(): + printinfo("Congratulations, You Win!") + exit(0) + +def loseending(): + printwarning("You lose!") + printerror("RuntimeError: CRASHING Computer........") + raise RuntimeError("You lose!")
\ No newline at end of file diff --git a/guessnum.py b/guessnum.py index c0194d6..341784d 100644 --- a/guessnum.py +++ b/guessnum.py @@ -1,5 +1,6 @@ from random import randint from stdlib import * +from gamelib import * def initnum(difficulty: int): global ansnum @@ -40,15 +41,6 @@ def askuserinit(): printerror("Please input a valid difficulty number(1 for easy, 2 for noraml, 3 for hard or n{num} for custom.") askuserinit() -def winending(): - printinfo("Congratulations, You Win!") - exit(0) - -def loseending(): - printwarning("You lose!") - printerror("RuntimeError: CRASHING Computer........") - raise RuntimeError("You lose!") - def userdet(): guestries = 0 while True: |
