Python Forum
Can someone please help me with my code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can someone please help me with my code?
#1
import time

answer_a = ["A", "a"]
answer_b = ["B", "b"]
answer_c = ["C", "c"]
yes = ["Y", "y", "Yes", "yes"]
no = ["N", "n", "No", "no"]
required = "Please use only A, B, or C"

print("please type 'start()' to start the game!")

def start():
    print("""\n
\n
After passing out from partying the entire night,
you wake up in a very dark and dense forest. Your head's spinning uncontrollably and your heart is racing.
behind you, you hear a very grotesque sound coming closer, and closer.
You look behind you and it's a wild boar with red eyes and foam spewing from it's mouth. Quickly, you: """)
    print("\nA. Grab a nearby stick to defend yourself \nB. stay still \nC. Run\n")
    choice = input(">>>")
    if choice in answer_a:
        option_stick()
    if choice in answer_b:
        dead()
    if choice in answer_c:
        option_run()
    else:
        print(required)
        start()


def option_stick():
    print("""\n
\n
\n
You whack the wild boar with a stick, and it hits the ground,
it gets back up on it's feet and starts to charge you! you: """)
    print("\nA. Climb a nearby tree \nB. hit it again! \nC. Kick it")
    choice1 = input(">>>")
    if choice1 in answer_a():
        option_climb()
    if choice1 in answer_b():
        option_hit()
    if choice1 in answer_c():
        option_kick()
    else:
        print(option_stick())

def option_climb():
    print("a")

def option_hit():
    print("b")

def option_kick():
    print("c")




def option_run():
    print("""\n
\n
\n
You decided to run from the wild boar,
but you end up at the face of a cliff, You: """)




def dead():
    print("You died, would you like to restart?: ")
    restart = input()
    if restart in yes:
        start()
    else:
        start()
Reply


Messages In This Thread
Can someone please help me with my code? - by AlluminumFoil - Dec-05-2019, 09:10 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020