#!/usr/bin/env python3
#Jessica Trickett
#Platt Tech Information Technology
#Today I am making a magic eightball/fortune teller program.
#The program will be able to predict the answer to a question you have.
#It can answer with little sayings, like "Without a doubt" or "Better not tell you now".
from random import choice
from os import system
#This function defines the system/window/host for the program.
def programExit():
#This will ask if you want to leave the program once you're finished, or if you'd like to continue.
exitAnswer = input("Do you want to go again? Y or N? ==>")
#This will ask the user if they want to continue.
if exitAnswer == "y":
#If they reply with yes...
mystic()
#The program will repeat.
elif exitAnswer == "n":
#If they reply with no...
print ("Goodbye")
#The program will exit.
else:
#If they reply with anything else...
programExit()
#The program will exit, since the program doesn't recognize anything other than y or n.
def mystic():
#This is the function that the program runs on.
system ("clear")
#This will clear the window.
print ("Welcome to my magic fortune teller!\n Here you can ask a yes or no question,\n and the power of my computer will go into\n the mystic depth, and give you the true answer.")
#This is the line introducting the fortune teller. This tells you about the function and what it does.
print()
#Blank line, or break.
myQuestion = input("What is your question? ==>")
#This asks the user what their question is.
system("clear")
#Once again, clears the window in use.
mysticAnswers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."]
#This is the library of answers, which is a wide variety of variations of yes and no.
print (choice(mysticAnswers))
#This will randomize one of the answers from the library.
programExit()
#Now, the program will ask if you want to continue.
if __name__ == "__main__":
mystic()