File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change
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
+ '''
1
15
from time import sleep
2
16
from random import randint
3
17
from colorama import Fore , Style
18
+
19
+ # response list..
4
20
response = [
5
21
"It is certain" ,
6
22
"It is decidedly so" ,
23
39
"Outlook not so good" ,
24
40
"Very doubtful" ]
25
41
42
+ # core game...
26
43
def game ():
27
44
ques = str (input ("What is your question? \n " ).lower ())
28
45
print ("thinking..." )
@@ -34,7 +51,7 @@ def game():
34
51
print (color + response [idx ]+ Style .RESET_ALL + '\n \n ' )
35
52
playloop ()
36
53
37
-
54
+ # looping func...
38
55
def playloop ():
39
56
ques_again = str (input ("Would you like to ask another question? (y/n)\n " ).lower ())
40
57
if ques_again == 'y' :
You can’t perform that action at this time.
0 commit comments