Magic 8 Ball.py (project)

Bulldog
by Bulldog · 3 posts
8 years ago in Python
Posted 8 years ago · Author
GOT ANY QUESTIONS? DIRECT THEM TO MAGIC 8 BALL. :lol:

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)

Code
# 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts