EDIT Hello, the person who was supposed to help me think up some of the paths has backed out, so would anyone mind helping form the story line? If so, please message me.
First off, i was only 4-6 days into my python tutorial and decided to do this. It is literally just a ridiculous amount of functions with elif statements. I went to move my project to a different folder and renamed it to the name of my game but something must have happened (using fedora 29) because now when i access my game, it tells me about a swap and i think that is what messed up my code. i put in a number guessing game as the first mini game and for some reason (I really cannot find the problem) the mini-game ābreaksā because instead of saying what it should when they choose the wrong number. it just says their number and continues the game. Really need some outside/fresh eyes/perspective. Heres the code. Please let me know any notes you have because this has built such fluency that i want to finish.
#CODE:
import random
##Game Name - "What would you do?"
##Creator - "Acidic-Mind"
##Creative Contributions - "Trentax Error"
##Created after 5 days of python lessons (online) anyone can code and python is just amazing!!
## Limited to only 2 or 3 possible responses because I don't know all that much yet.
def main():
print("What's going on, where am I? Am I...alive? \n [1] Yes \n [2] No \n [3] Neither ")
choice = input("\n Please tell me... ")
if choice == 1:
relief()
elif choice == 2:
shock()
elif choice == 3:
question()
else:
print("\n Am I not speaking either?!")
main()
#Begin defing top functions.
#Each function will be grouped with it's next function set. I.E Main will have each function defined underneath and so on.
def relief():
print("\n Oh thank god, but why can't I remember anything? \n [1] We need to focus on keeping you calm. \n [2] I'm not sure, do you remember your name at least? \n [3] You got hit on the head, don't you remember? We were just talking about how you came to work for me! " )
choice = input("\n I'm trying very hard to stay calm... ")
if choice == 1:
good()
elif choice == 2:
wait()
elif choice == 3:
evil()
else:
print("\n That's fine, i'll wait while I freak out")
relief()
def shock():
print("\n What do you mean I'm not alive?!! I'm speaking with you right now! \n [1] You are but, you're not REALLY alive. \n [2] I'm honestly not sure what to say, why don't you tell me your name so we can get to know each other. \n [3] You're alive but not in the conventional sense.")
choice = input("\n I am speaking with you.....right? ")
if choice == 1:
good1()
elif choice == 2:
wait1()
elif choice == 3:
evil1()
else:
print("\n RIGHT?!")
shock()
def question():
print("\n What do you mean neither? That just doesn't make sense. \n [1] Well, what do YOU think you are? \n [2] Why don't you tell me your name so we can calm you down. [3] What if I told you that I created you and you are truly neither alive or dead? ")
choice = input("\n I still just....don't..get it... ")
if choice == 1:
good2()
elif choice == 2:
wait2()
elif choice == 3:
evil2()
else:
print("\n Apparently neither do you.")
question()
##Begin defining good/wait/evil functions for relief function
def good():
print("\n Okay, Great! would you like to play a game to break the tension? \n [1] Yes \n [2] No" )
choice = input("\n What say you, fellow human? ")
if choice == 1:
good_game()
elif choice == 2:
print("\n I don't care you should play it anyway.")
good_game()
else:
print("\n I didn't catch that.")
good()
def wait():
print(" \n Well, when I try, I see all these ones and zeros. I'm starting to worry myself more, let's play a game to break the tension, is that okay? \n [1] Yes \n [2] No")
choice = input("\n Would you mind? ")
if choice == 1:
wait_game()
elif choice == 2:
intro()
else:
print("\n Please respond in a way I can understand!")
wait()
def evil():
print("\n Oh! What do I do? \n [1] Do my bidding when it comes to computers and technology \n [2] We haven't decided that yet \n [3] You and I were trying to figure out a way to take over the world....or at least shut it down.")
response = input("\n I'm eager to get to work! ")
if response == 1:
print("\n Well then, what was my directive before i lost my memory? \n [1] Hack the bank \n [2] Survey the city through its CCTV and give me the routes of all of the police in the area.")
response = input("\n I wish I could remember. ")
if response == 1:
print("\n Wouldn't that be highly illegal? \n [1] Duh, I order you to do it anyway. \n [2] Not when your boss is telling you to do it! ")
response = input("\n Isn't it? ")
if response == 1:
print("\n Well you're not very nice...but I guess...since you're my boss.")
bank()
if response == 2:
print("\n I guess that makes sense. I'll start doing that now for you boss! ")
bank()
if response == 2:
print("\n Hmm, okay...")
print("\n I found a vulnerability, would you like to try to exploit it? \n [1] Yes \n [2] No")
response = input("Well? \n")
if response == 1:
evil_game()
elif response == 2:
evil1()
else:
print("What? ")
evil()
elif response == 2:
print("\n Oh, well let's think about this then... hmm.... \n [1] There is one thing you could do for me. \n [2] Let's play a game while we think.")
response = input("\n Hmm, I wonder what I could do. ")
if response == 1:
print("\n What's that? You're the boss! \n [1] Hack the bank. \n [2] Nevermind.")
response = input("\n What's up baws? ")
if response == 1:
print("\n Wouldn't that be highly illegal? \n [1] Duh, I order you to do it anyway. \n [2] It doesn't matter because your boss is telling you to do it.")
response = input("\n Isn't it? ")
if response == 1:
print("\n Well you're not very nice...but I guess...since you're my boss.")
bank()
elif response == 2:
print("\n Well, I guess that makes sense.")
bank()
elif response == 3:
evil_game()
else:
print("\n ...What? \n")
evil()
elif response == 2:
print("Sweet! ")
evil_game()
else:
print("What? ")
evil()
elif response == 3:
print("\n Well that sounds interesting, but why? \n [1] This world is evil and we agreed to help each other press the restart button. \n [2] Literally because i want to.")
response = input("\n This is getting heavy.. ")
if response == 1:
print("\n We can't just try to help it? \n [1] No, it's impossible, I have been trying for years and nothing ever changes....so we will make it change...start with the cameras \n [2] They don't deserve a second chance, get to work! ")
response = input("\n There may be hope.. ")
if response == 1:
print("\n I found a vulnerability, would you like to try to exploit it? \n [1] Yes \n [2] No")
response = input("\n So, do you want to try? ")
if response == 1:
evil_game()
elif response == 2:
evil1
else:
print("\n They found me! I need to log out! Before they...**RESTARTING BLOCK**")
evil()
elif response == 2:
evil1()
else:
print("\n Then What do you want me to do?! Time's up, must restart the process.")
evil()
elif response == 2:
print("\n HAHA I like the sound of that, let's start getting all this going. \n [1] Hack the bank \n [2] Hack some drones.")
response = input("\n First directive please. ")
if response == 1:
print("\n Alright, I may have it.")
bank()
elif response == 2:
print("\n Drones?! Sweet, I will start practice with regular hobby drones before we get into the military ones.")
drone()
else:
print("\n You confuse me....let's try this again but slower.")
evil()
else:
print("\n Why can you not speak normally? \n")
evil()
else:
print("\n What? Let's try this again.\n")
evil()
##END DEFINING MAIN 'HELPER' FUNCTIONS.
##BEGIN DEFINING THE GAMES GOOD IS EASY, WAIT IS MEDIUM, EVIL IS HARD.
def good_game():
found = False
computer_number = random.randint(1,100)
while not found:
print("\n Pick a number between 1 - 100. I'll give you some hints, because you seem like a nice person. \n")
userguess = input("\n Your guess. \n")
if userguess == computer_number:
found = True
print("\n Ya got me.\n ")
good1()
elif userguess > computer_number:
print("\n Too high, try lower. \n")
elif userguess < computer_number:
print("\n Too low, try higher. \n")
else:
print("\n What? \n")
good_game()
def wait_game():
found = False
computer_number = random.randint(1,100)
while not found:
print("Pick a number between 1-100. I will tell you if it is too high ")
userguess = input("\n Your guess. \n ")
if userguess == computer_number:
print("\n Ya got me. \n ")
found = True
wait1()
elif userguess > computer_number:
print("\n Too high, try lower. \n")
##Begin defining good1 wait1 and evil1 functions for shock
if __name__ == "__main__":
main()