@Nathan2196/

RandomNumberGame

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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#\033[1;37;42m, 
from random import randint
import time
input11 = 0
input1 = 0
input2 = 0
input3 = 0
input4 = 0
input5 = 0
ab = 8
bc = 8
cd = 46
de = 52
a = 0
b = 0
c = 0
d = 0
e = 0
f = 0
g = 0
h = 0
i = 0
j = 0
k = 0
x = 0
z = 0
p = 0
y = False
random1 = 0
random2 = 20
print("")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("This is a random number guessing game!")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("")
print("")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("Instructions : You will have 3 seconds to memorize the 4 numbers printed. Then the numbers will clear and you will enter them one at a time. Gradually, the game will get harder. When you are ready press any key.")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
while(x < 5):
  print("")
  print("")
  print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
  print("To view the instructions, press 'q' and 'enter', if you are ready press 'enter'.")
  print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
  print("")
  input5 =  input()
  if input5 == 'q':
    print("")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("Instructions : You will have 3 seconds to memorize the 4 numbers printed. Then the numbers will clear and you will enter them one at a time. When you are ready press 'enter'.")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
  else:
    ''''''
    a = randint(random1, random2)
    b = randint(random1, random2)
    c = randint(random1, random2)
    d = randint(random1, random2)
    random1 = random1 + randint(0, 5)
    random2 = random2 + randint(0, 10)
    print("")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    while(ab > 0):
      time.sleep(0.15)
      print("")
      ab = ab - 1
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    while(bc > 0):
      time.sleep(0.15)
      print("")
      bc = bc - 1
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    while(cd > 0):
      time.sleep(0.15)
      print("")
      cd = cd - 1
    print("")
    print("")
    print("Your numbers are:")
    print(a)
    print(b)
    print(c)
    print(d)
    time.sleep(2)
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!~3!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    time.sleep(0.3)
    print("")
    time.sleep(0.3)
    print("")
    time.sleep(0.3)
    print("")
    time.sleep(0.1)
    print("")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!~2!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    time.sleep(0.3)
    print("")
    time.sleep(0.3)
    print("")
    time.sleep(0.3)
    print("")
    time.sleep(0.1)
    print("")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!~1!")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    while(de > 0):
      time.sleep(0.15)
      print("")
      de = de - 1
    print("Press 'enter' when you are ready to submit your guess.")
    input2 = (int(input("Guess 1 : ")))
    input3 = (int(input("Guess 2 : ")))
    input4 = (int(input("Guess 3 : ")))
    input5 = (int(input("Guess 4 : ")))
    if input2 == a:
      e = True
    else:
      ''''''
    if input3 == b:
      f = True
    else:
      ''''''
    if input4 == c:
      g = True
    else: 
      ''''''
    if input5 == d:
      h = True
    else: 
      ''''''
    if (e == True):
      i = i + 1
    else:
      ''''''
    if(f == True):
      i = i + 1
    else:
      ''''''
    if(g == True):
      i = i + 1
    else:
      ''''''
    if(h == True):
      i = i + 1
    else:
      ''''''
    z = z + 1
    print("Loading...")
    time.sleep(0.5)
    print("")
    i = 4 - i
    print("")
    if(i <= 4):
      if(i == 4):
        print("You got 0 of the numbers correct")
      else:
        if(i <= 3):
          if(i == 3):
            print("You got 1 of the numbers correct")
          else:
            if(i <= 2):
              if(i == 2):
                print("You got 2 of the numbers correct")
              else:
                if(i <= 1):
                  if(i == 1):
                    print("You got 3 of the numbers correct")
                  else:
                    print("You got all of the numbers correct!")
                    k = k + 1
    print("")  
    p = k / z
    p = p * 100
    print("Your score is : ", k)
    print("Out of a possible : ",z, "tries.", p,"%")
    print("")
    print("Loading...")
    time.sleep(0.5)
    i = 0
    e = False
    f = False
    g = False
    h = False
    a = 0
    b = 0 
    c = 0 
    d = 0
    ab = 8
    bc = 8
    cd = 46 
    de = 52