File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 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+ '''
115from time import sleep
216from random import randint
317from colorama import Fore , Style
18+
19+ # response list..
420response = [
521 "It is certain" ,
622 "It is decidedly so" ,
2339 "Outlook not so good" ,
2440 "Very doubtful" ]
2541
42+ # core game...
2643def 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...
3855def playloop ():
3956 ques_again = str (input ("Would you like to ask another question? (y/n)\n " ).lower ())
4057 if ques_again == 'y' :
You can’t perform that action at this time.
0 commit comments