Last active
April 7, 2021 21:28
-
-
Save nonaybay/ca9117f1b17b0186eebba374d0708ac2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Port from rust-lang Guessing Game: | |
# link: https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html | |
import random | |
SN = random.randint(0, 101) | |
def main(): | |
print('+ Guess the number') | |
ug = int(input('+ Please, input your guess: ')) | |
print('+ OK! Your guess <{}>'.format(ug)) | |
if (ug != SN): | |
if (ug < SN): | |
print('\n\n- too small!\n\n+ Try again!\n') | |
main() | |
else: | |
print('\n\n- too big!\n\n+ Try again!\n') | |
main() | |
else: | |
print('\n\n\n\n~ ! ! ! ! y o u w i n ! ! ! ! ~\n\n\n\n') | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment