Last active
April 15, 2021 05:33
-
-
Save heriksevak/0caa31ea0a64a8c4c24efa5a2b4fca19 to your computer and use it in GitHub Desktop.
simple situation game
This file contains 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
def challange_1(): | |
print("welcome to the kreh game") | |
print("you set off with your family") | |
print("you hear screams") | |
print("a bear attacks you and your little son") | |
print("you have a choice") | |
print("a. grab a gun") | |
print("b. run for your life") | |
user_input = input() | |
if user_input == "a": | |
print("you shoot the bear and survive") | |
return "alive" | |
elif user_input == "b": | |
print("you run away but bear cought you") | |
return "dead" | |
else: | |
print("you fail to do any thing") | |
return "dead" | |
def challange_2(): | |
#challange | |
print("a mystic meets you on the road and says he's thinking number between his number or you will die") | |
print("guess the numbers from 1-10") | |
user_input = int(input()) | |
if user_input > 3 and user_input < 7: | |
print("wow you somehow survived") | |
return "alive" | |
else: | |
print("you were wrong. the mystic magic puts a spell on you and you melt and die") | |
return "dead" | |
def challange_3(): | |
print("you have to cross a land known for snakes") | |
print("pick a number between 10 and 15 ") | |
user_input = int(input()) | |
if user_input < 10 or user_input > 15: | |
print("you didnt follow rule u died") | |
return "dead" | |
else: | |
if user_input != 13: | |
print("the snake does not attack you") | |
return "alive" | |
else: | |
print("you know it was unlucky no.") | |
return "dead" | |
import random | |
alive = "alive" | |
while alive == "alive": | |
challange_number = random.randint(1,3) | |
if challange_number == 1: | |
alive = challange_1() | |
elif challange_number == 2: | |
alive = challange_2() | |
elif challange_number == 3: | |
alive = challange_3() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment