Python Forum
Adventure book of your choice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adventure book of your choice
#1
This has been my latest activity in a python learning course and it turned out sooooooooooooo well that I decided to share it with the community I really appreciate your attention.

Thanks, foksikrasa.

import time

delay = int(input("How many seconds would you like to wait between each quote?"))

def print_with_delay(text):
    print(text)
    time.sleep(delay)

def choose(option1, option2):
    choice = input(option1 + " or " + option2 + "?").lower()
    if choice == option1:
        return option1
    elif choice == option2:
        return option2
    else:
        return None

print_with_delay("Chapter one, the way to The Country Of Talking Animals\n------------------------------------------------------")

name = input("\nEnter your name, traveler:")

print_with_delay(str(name) + " I've been looking all over for you!")
print_with_delay("Today I've bought this nekclace but it is special...")
print_with_delay("It is a nekclace that will let you transform.")
print_with_delay("I've bought it for you, " + str(name))
print_with_delay("It will help you on your adventure now choose. There are two paths.")

direction = choose("left", "right")

print("Bye traveler!")

if direction == "left":
    print_with_delay("You have decided to save a magic country from the evil wich!")
    print_with_delay("You travel long and far to come to the magic land surrounded by vast deserts and cold oceans.")
    print_with_delay("But which way? there are two paths, both are dangerous to choose:")

    direction = choose("left", "right")

    if direction == "right":
        print("You shall set sail in the morning.")
    elif direction == "left":
        print("Get ready, for tomorrow might be your last day to live.")
    else:
        print("That is not a direction.")
elif direction == "right":
    print("You walk into thick woods but oh no! You find a Goblin, he notices you, and begins to chase you.\n You try to run away but he is too fast for you.")
    print("GAME OVER the Goblin ate you :(")
else:
    print("That is not a direction.")
Reply


Messages In This Thread
Adventure book of your choice - by foksikrasa - May-28-2020, 03:24 PM
RE: Adventure book of your choice - by pyzyx3qwerty - May-31-2020, 06:18 AM
RE: Adventure book of your choice - by Knight18 - May-31-2020, 06:44 AM
RE: Adventure book of your choice - by Calli - May-31-2020, 11:42 AM
RE: Adventure book of your choice - by foksikrasa - Jun-17-2020, 10:03 AM
RE: Adventure book of your choice - by BitPythoner - Jul-16-2020, 02:21 PM

Forum Jump:

User Panel Messages

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