I made you a Magic Eight Ball so that you don't have to.
Simply Python. Accepts question as a parameter or from a pipe.
$ echo -e "Are we there yet?" | m8b.py
Your question: Are we there yet?
My answer: You may rely on it.
$ ./m8b.py "Do I need more coffee?"
Your question: Do I need more coffee?
My answer: Most likely.
Code:
#!/usr/bin/python3
from random import randrange
import sys
ballmap = {
1: "It is certain.",
2: "It is decidedly so.",
3: "Without a doubt.",
4: "Yes – definitely.",
5: "You may rely on it.",
6: "As I see it, yes.",
7: "Most likely.",
8: "Outlook good.",
9: "Yes.",
10: "Signs point to yes.",
11: "Reply hazy, try again.",
12: "Ask again later.",
13: "Better not tell you now.",
14: "Cannot predict now.",
15: "Concentrate and ask again.",
16: "Don't count on it.",
17: "My reply is no.",
18: "My sources say no.",
19: "Outlook not so good.",
20: "Very doubtful."
}
def main():
if len(sys.argv) > 1:
q = sys.argv[1]
elif not sys.stdin.isatty():
q = sys.stdin.readlines()
q = q[0]
res = ballmap[randrange(1,20)]
if "q" in locals():
print("Your question: " + q.rstrip())
print("My answer: " + res)
if __name__ == '__main__':
main()