repl.it
@TheFlooBearer/

Magic 8 Ball

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import os
import math
import random
import time


while True:
  os.system('clear')
  
  # Prompts user to environment
  print ("This is a magic eight ball. Please enter your yes/no question.\n\n")
  # Prompts user to enter input
  question = input('Enter Here.\n')
  
  # Sets the variable for the random integer used to define what your answer will be.time
  ans = random.randint(1,20)
  print ("\n")
  # Begins word bank
  if ans == 1:
    # Prints a feedback answer
    print ('It is certain.')
    # Causes the program to wait and show the text before closing the program. For aesthetic.
    time.sleep(2)
  if ans == 2:
    print ('As I see it, yes.')
    time.sleep(2)
  if ans == 3:
    print ('Don\'t count on it.')
    time.sleep(2)
  if ans == 4:
    print ('It is decidedly so.')
    time.sleep(2)
  if ans == 5:
    print ('Most likely')
    time.sleep(2)
  if ans == 6:
    print ('Ask again later.. maybe five minutes?')
    time.sleep(5)
  
  if ans == 7:
    print ('My reply is no.')
    time.sleep(2)
  if ans == 8:
    print ('Without a doubt.')
    time.sleep(2)
  if ans == 9:
    print ('Outlook good.')
    time.sleep(2)
  if ans == 10:
    print ('Better not tell you now.')
    time.sleep(2)
  if ans == 11:
    print ('My sources say no.')
    time.sleep(2)
  if ans == 12:
    print ('Yes, definitely.')
    time.sleep(2)
  if ans == 13:
    print ('Yes.')
    time.sleep(2)
  if ans == 14:
    print ('Cannot predict now.')
    time.sleep(2)
  if ans == 15:
    print ('Outlook not so good.')
    time.sleep(2)
  if ans == 16:
    print ('You may rely on it.')
    time.sleep(2)
  if ans == 17:
    print ('Signs point to yes.')
    time.sleep(2)
  if ans == 18:
    print ('Concentrate and ask again.')
    time.sleep(2)
  if ans == 19:
    print ('Very doubtful.')
    time.sleep(2)
  if ans == 20:
    print ('Sure.')
    time.sleep(2)
  if ans > 21 or ans < 1:
    print ('We\'re not sure how you got here, so... Good job? I hope you\'re proud of breaking the program.')
    time.sleep(10)