Posted 9 years ago
·
Author
GOT ANY QUESTIONS? DIRECT THEM TO MAGIC 8 BALL.
Really though. i was looking for a project to do in python. came across the ''MAGIC 8 BALL" project on stackoverflow site. i thought it was cool. so i decided to tackle it. check it out:
( this was good practice for me)
Download the EXE :https://www.dropbox.com/s/hva02j74g73bbi7/Magic%208%20Ball.zip?dl=0
Really though. i was looking for a project to do in python. came across the ''MAGIC 8 BALL" project on stackoverflow site. i thought it was cool. so i decided to tackle it. check it out:
( this was good practice for me)
# MAGIC 8 BALL | FEEL FREE TO ASK YOUR QUESTIONS
# by. BULLDOG / 6:06 :AM
import random
import time
#******** function #2 begins **********************#
def userPrompt():
time.sleep(3.0)
print(".....")
this_input = raw_input("Would you like to ask another question? Y/N :")
if this_input == "y" or this_input == "Y":
user = raw_input("Ask: a ?: ")
randomResponse()
elif this_input == "n" or this_input == "N":
print("MAGIC 8 BALL WILL NOW GO TO SLEEP.")
#******** function #2 ends **********************#
#******** function #1 begins **********************#
def randomResponse():
response = ["Only god knows","Signs point to yes","Without a doubt","Jacob","Cannot predict now","Don't count on it","No","Yes","Ask again later","hello","i dont see why not","It is decidedly so","Most likely","Are you kidding?","Go for it!","Goodbye","me","Who knows?","life is full of excitement","Stuff happens","Don't bet on it"]
print(random.choice(response))
userPrompt()
#******** function #1 ends **********************#
#**** Main function ***********#
user_q = raw_input("Ask a ?: ")
if user_q:
print("Thinking.....")
randomResponse()
Download the EXE :https://www.dropbox.com/s/hva02j74g73bbi7/Magic%208%20Ball.zip?dl=0