User Controls

Ask the Magic Python 8Ball anything!

  1. #1
    Sophie Pedophile Tech Support

    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]
  2. #2
    will i find substantial fulfillment in life
  3. #3
    Sophie Pedophile Tech Support
    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.
  4. #4
    Neat mate might give it a try if i install python on my machine.
  5. #5
    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!:
  6. #6
    Sophie Pedophile Tech Support
    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.
  7. #7
    Lanny Bird of Courage
    Why `tuple(answers)`? random.choice should work over any iterable
  8. #8
    Sophie Pedophile Tech Support
    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.
Jump to Top