Skip to content

Commit b707a97

Browse files
updated magic8ball.py, module doc added.
1 parent 4aa70af commit b707a97

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

magic8ball.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1+
'''Author Anurag Kumar(mailtoanuragkumarak95@gmail.com)
2+
Module for implementing the simpest Magic 8 Ball Game.
3+
4+
Python:
5+
- 3.5
6+
7+
Requirements:
8+
- colorama
9+
10+
Usage:
11+
- $python3 magic8ball.py
12+
13+
Ask a question, and know the future.
14+
'''
115
from time import sleep
216
from random import randint
317
from colorama import Fore, Style
18+
19+
# response list..
420
response = [
521
"It is certain",
622
"It is decidedly so",
@@ -23,6 +39,7 @@
2339
"Outlook not so good",
2440
"Very doubtful"]
2541

42+
# core game...
2643
def game():
2744
ques = str(input("What is your question? \n").lower())
2845
print ("thinking...")
@@ -34,7 +51,7 @@ def game():
3451
print (color+response[idx]+Style.RESET_ALL+'\n\n')
3552
playloop()
3653

37-
54+
# looping func...
3855
def playloop():
3956
ques_again = str(input("Would you like to ask another question? (y/n)\n").lower())
4057
if ques_again == 'y':

0 commit comments

Comments
 (0)