Skip to content

Instantly share code, notes, and snippets.

@wopian
Created February 14, 2016 19:31
Show Gist options
  • Save wopian/cd7f6f1d41cd7f699f4f to your computer and use it in GitHub Desktop.
Save wopian/cd7f6f1d41cd7f699f4f to your computer and use it in GitHub Desktop.
from time import sleep
import time
import sys
import random
from random import uniform
from array import array
# MAGIC 8 Welcome
answer = [
"Are you kidding?",
"As I see it,"
"Ask again later.",
"Better not tell you\n now.",
"Cannot predict now.",
"Concentrate and ask\n again.",
"Definitely not.",
"Don't bet on it.",
"Don't count on it.",
"Forget about it.",
"Go for it!",
"I have my doubts.",
"It is certain.",
"It is decidedly so.",
"Looking good!",
"Looks good to me!",
"Most likely.",
"My reply is no.",
"My sources say no.",
"Outlook good.",
"Outlook not so\n good.",
"Outlook so so.",
"Probably.",
"Reply hazy try again.",
"Signs point to yes.",
"Very doubtful.",
"Who knows?",
"Without a doubt.",
"Yes.",
"Yes definitely.",
"You may rely on it.",
"You will have to\n wait.",
"In due time."
]
def Type(lines, sleeping):
for (i, line) in enumerate(lines):
for x in line:
print(x, end='')
sys.stdout.flush()
sleep(sleeping)
def Answer(question):
if question:
answers = random.randint(0, 19)
Type([
"\n " + answer[answers] + "\n\n\n\n * * * *\n"
], .05)
else:
Type([
"\n oops!\n No question asked.\n\n\n * * * *\n"
], .05)
AskQuestion()
def Question():
#question = input("> ")
Answer(input("> "))
def AskQuestion():
Type([
"\n\n\n Ask me a question:\n\n "
], .05)
Question()
def Welcome():
Type([
"\n *** ### ### ***\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *## ##*\n",
" *######## ########*\n",
" *############## ##############*\n",
" *#################################################*\n",
" *## ########## MAGIC 8 BALL ########## ##*\n",
" *## ####################### ##*\n",
" *## ##*\n",
" *## ##*\n",
" *# ##*\n",
" *## ##*\n",
" *## ##*\n",
" *** ### ### ***\n"
], .01)
AskQuestion()
Welcome()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment