User Controls
Ask the Magic Python 8Ball anything!
-
2016-09-25 at 4:35 PM UTC
import random
def main():
answers = ["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"]
while True:
try:
question = raw_input("Ask the magic Python 8 ball anything!: ")
if question == '':
print "\nThe magic Python 8 ball did not understand!"
else:
result = random.choice(tuple(answers))
print ""
print result
except KeyboardInterrupt:
print "[!]Critical, user aborted."
break
main()
Ask the magic Python 8 ball anything!: am i amazing?
It is decidedly so
Thanks magic Python 8Ball! (This magic python 8ball is the intellectual property of Sophie, it is released under GNU General Public Liscense. Please note that the magic python 8ball cannot predict the future and i will not be held liable for any damages caused by your decisions being influenced by the magic python 8ball.)
THANK YOU [SIZE=28px]AMEN![/SIZE] -
2016-09-25 at 5:07 PM UTCwill i find substantial fulfillment in life
-
2016-09-25 at 5:41 PM UTC
will i find substantial fulfillment in life
Sophie@Ubuntu:~$ python 8ball.py
Ask the magic Python 8 ball anything!: Will enter find substantial fullfilment in life?
Concentrate and ask again
Ask the magic Python 8 ball anything!: Ok will he?
Very doubtful
Ask the magic Python 8 ball anything!:
Haha. You can't make this stuff up. -
2016-09-25 at 5:57 PM UTCNeat mate might give it a try if i install python on my machine.
-
2016-09-25 at 6:40 PM UTCdid i do it rite
Ask the magic Python 8 ball anything!: will I be a famous LSD chemist
Yes
Ask the magic Python 8 ball anything!: Is sophia a nigger?
Cannot predict now
Ask the magic Python 8 ball anything!: WHAT THE FUCK 8BALL DID I DO THIS WRONG?
My sources say no
Ask the magic Python 8 ball anything!: ARE YOU CODED PROPERLY?
Without a doubt
Ask the magic Python 8 ball anything!: okay seems legit 2 me nigga. Will I live forever?
Yes
Ask the magic Python 8 ball anything!: SWEET, what about SC?
My sources say no
Ask the magic Python 8 ball anything!: NOOO!!!!.. what about soph?
Cannot predict now
Ask the magic Python 8 ball anything!: the fudge.. is this working?
Most likely
Ask the magic Python 8 ball anything!: -
2016-09-25 at 6:45 PM UTC
did i do it rite
Ask the magic Python 8 ball anything!: will I be a famous LSD chemist
Yes
Ask the magic Python 8 ball anything!: Is sophia a nigger?
Cannot predict now
Ask the magic Python 8 ball anything!: WHAT THE FUCK 8BALL DID I DO THIS WRONG?
My sources say no
Ask the magic Python 8 ball anything!: ARE YOU CODED PROPERLY?
Without a doubt
Ask the magic Python 8 ball anything!: okay seems legit 2 me nigga. Will I live forever?
Yes
Ask the magic Python 8 ball anything!: SWEET, what about SC?
My sources say no
Ask the magic Python 8 ball anything!: NOOO!!!!.. what about soph?
Cannot predict now
Ask the magic Python 8 ball anything!: the fudge.. is this working?
Most likely
Ask the magic Python 8 ball anything!:
Yay! You did! CTRL+C breaks the loop. Love how the 8Ball responds with: "Most likely" after you ask it whether it is working. Lmao. -
2016-09-25 at 9:16 PM UTCWhy `tuple(answers)`? random.choice should work over any iterable
-
2016-09-25 at 10:38 PM UTC
Why `tuple(answers)`? random.choice should work over any iterable
Confirmed.
Last time i tried to iterate over a list(sequence[whatever]) with random.choice i seem to remember i had some list index out of range error that was helped by specifying a tuple or that's how i remember it. That was back in the day when i still ran Wanblows as main OS so maybe it has something to do with Python on windows. Or maybe i am just being retarded, this is a very real possibility. Let me ask my 8 ball.
Sophie@Ubuntu:~$ python 8ball.py
Ask the magic Python 8 ball anything!: Hello 8 ball, am i being retarded?
It is certain
Ask the magic Python 8 ball anything!:
Welp.
I feel like keeping my `tuple(answers)` for some reason though.