-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRED Pattern Framework.py
283 lines (283 loc) · 8.44 KB
/
RED Pattern Framework.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
#RED Pattern Framework (RPF)
#Init, imports, vars
import random
import time
ptype = "Blank"
waittime = True
pttrnnum = 0
lcount = 0
hcount = 0
#Functuons
def length():
global glength
while True:
glength = input("Enter length:")
try:
val1 = int(glength)
if val1 >= 2 & val1 <= 10:
break
else:
print("Length must be 2 or more, 10 or less.")
except ValueError:
print("Amount must be a whole number.")
return val1
def height():
global gheight
while True:
gheight = input("Enter height:")
try:
val2 = int(gheight)
if val2 >= 2 & val2 <= 10:
break
else:
print("Height must be 2 or more, 10 or less.")
except ValueError:
print("Amount must be a whole number.")
return val2
#Intro + Type
print("""Welcome to the
__ ___ __
[__)[__ | \\
| \[___|__/ Pattern Framework
v 1.8.5,
TR77, Durian Technologies 2022
""")
print("""Patterns:
\"A\" = Random Custom
\"B\" = \"Arrow\" Style 5x5
\"C\" = \"Butterfly\" Style 5x5
Commands:
\"X\" = Debug (REMOVE THIS IN FINAL VERSION)
\"Y\" = Toggle pause time
\"Z\" = Quit this Program""")
#Input line
while (ptype != "Z"):
ptype = input("Enter a Letter:")
#Waittime toggle
if ptype == "Y":
waittime = not waittime
print("Wait time toggled.")
print("Wait time on?: " + str(waittime))
#Type A Custom
if ptype == "A":
length()
height()
print("Your grid is " + str(glength) + "x" + str(gheight))
lcount = glength
hcount = gheight
llist = []
for i in range(int(glength)):
llist.append("X")
for i in range(int(gheight)):
print(llist)
#Type B Butterfly Patern
if ptype == "B":
cX1 = random.randint(1,3)
cY1 = random.randint(1,3)
cO1 = random.randint(1,3)
cZ1 = random.randint(1,3)
cR1 = random.randint(1,3)
cT1 = random.randint(1,3)
cL1 = random.randint(1,3)
cF1 = random.randint(1,3)
cC1 = random.randint(1,3)
if cX1 == 1:
cX2 = "░░░"
elif cX1 == 2:
cX2 = "▒▒▒"
elif cX1 == 3:
cX2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cY1 == 1:
cY2 = "░░░"
elif cY1 == 2:
cY2 = "▒▒▒"
elif cY1 == 3:
cY2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cO1 == 1:
cO2 = "░░░"
elif cO1 == 2:
cO2 = "▒▒▒"
elif cO1 == 3:
cO2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cZ1 == 1:
cZ2 = "░░░"
elif cZ1 == 2:
cZ2 = "▒▒▒"
elif cZ1 == 3:
cZ2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cR1 == 1:
cR2 = "░░░"
elif cR1 == 2:
cR2 = "▒▒▒"
elif cR1 == 3:
cR2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cT1 == 1:
cT2 = "░░░"
elif cT1 == 2:
cT2 = "▒▒▒"
elif cT1 == 3:
cT2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cL1 == 1:
cL2 = "░░░"
elif cL1 == 2:
cL2 = "▒▒▒"
elif cL1 == 3:
cL2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cF1 == 1:
cF2 = "░░░"
elif cF1 == 2:
cF2 = "▒▒▒"
elif cF1 == 3:
cF2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
if cC1 == 1:
cC2 = "░░░"
elif cC1 == 2:
cC2 = "▒▒▒"
elif cC1 == 3:
cC2 = "▓▓▓"
else:
print("error in random number generation.")
quit()
print("Arrow Pattern (C):")
if waittime == True:
time.sleep(.5)
print(str(cR2) + str(cT2) + str(cL2) + str(cF2) + str(cC2))
print(str(cZ2) + str(cR2) + str(cT2) + str(cL2) + str(cF2))
print(str(cO2) + str(cZ2) + str(cR2) + str(cT2) + str(cL2))
print(str(cY2) + str(cO2) + str(cZ2) + str(cR2) + str(cT2))
print(str(cX2) + str(cY2) + str(cO2) + str(cZ2) + str(cR2))
pttrnnum = pttrnnum + 1
if waittime == True:
time.sleep(1)
#Type C Butterfly Patern
if ptype == "C":
if waittime == True:
time.sleep(.5)
typectype = input("""
Type of Pattern:
\"A\" = Complex
\"B\" = Basic""")
typectype = input("Enter a Letter:")
if typectype == "A":
cX1 = random.randint(1,6)
cY1 = random.randint(1,6)
cO1 = random.randint(1,6)
if cX1 == 1:
cX2 = "░"
elif cX1 == 2:
cX2 = "▒"
elif cX1 == 3:
cX2 = "▓"
elif cX1 == 4:
cX2 = "█"
elif cX1 == 5:
cX2 = "▯"
elif cX1 == 6:
cX2 = "◇"
else:
print("error in random number generation.")
quit()
if cY1 == 1:
cY2 = "▞"
elif cY1 == 2:
cY2 = "▟"
elif cY1 == 3:
cY2 = "◯"
elif cY1 == 4:
cY2 = "▬"
elif cY1 == 5:
cY2 = "◍"
elif cY1 == 6:
cY2 = "◦"
else:
print("error in random number generation.")
quit()
if cO1 == 1:
cO2 = "■"
elif cO1 == 2:
cO2 = "▢"
elif cO1 == 3:
cO2 = "▣"
elif cO1 == 4:
cO2 = "▦"
elif cO1 == 5:
cO2 = "▧"
elif cO1 == 6:
cO2 = "▩"
else:
print("error in random number generation.")
quit()
if typectype == "B":
cX1 = random.randint(1,3)
cY1 = random.randint(1,3)
cO1 = random.randint(1,3)
if cX1 == 1:
cX2 = "░"
elif cX1 == 2:
cX2 = "▒"
elif cX1 == 3:
cX2 = "▓"
else:
print("error in random number generation.")
quit()
if cY1 == 1:
cY2 = "░"
elif cY1 == 2:
cY2 = "▒"
elif cY1 == 3:
cY2 = "▓"
else:
print("error in random number generation.")
quit()
if cO1 == 1:
cO2 = "░"
elif cO1 == 2:
cO2 = "▒"
elif cO1 == 3:
cO2 = "▓"
else:
print("error in random number generation.")
quit()
print("Butterfly Pattern (C):")
if waittime == True:
time.sleep(.5)
print(str(cX2) + " " + str(cX2) + " " + str(cO2) + " " + str(cX2) + " " + str(cX2))
print(str(cX2) + " " + str(cY2) + " " + str(cO2) + " " + str(cY2) + " " + str(cX2))
print(str(cO2) + " " + str(cO2) + " " + str(cO2) + " " + str(cO2) + " " + str(cO2))
print(str(cX2) + " " + str(cY2) + " " + str(cO2) + " " + str(cY2) + " " + str(cX2))
print(str(cX2) + " " + str(cX2) + " " + str(cO2) + " " + str(cX2) + " " + str(cX2))
pttrnnum = pttrnnum + 1
if waittime == True:
time.sleep(1)
#debug
if ptype == "X":
print("Wait Time: " + str(waittime))
print("Pattern Count: " + str(pttrnnum))
#Input not recognized
if ptype == "Z":
print("Thank you for using RPF.")
quit()