-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowseCircles.py
58 lines (51 loc) · 1.14 KB
/
browseCircles.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
import mpca
import os
size = 1
mode = 0
modes = "nsi"
current = mpca.RasterCircle(size)
command = ""
prompt = "Raster Circle Browser\n" + \
"Commands:\n\t" + \
"w: Increase Size\n\t" + \
"s: Decrease Size (Minimum: 1)\n\t" + \
"e: Set Size (Minimum: 1)\n\t" + \
"a/d: Cycle Drawing Modes\n\t" + \
"q: Exit\n" + \
"$ "
while command != 'Q':
os.system("clear")
current.printASCII()
print("Current size:", str(size))
command = str(input(prompt)).upper()
if command == "Q":
continue
elif command not in "WASDE":
print("Error: Unknown command.")
input("(Press any key...)")
continue
if command == "W":
size += 1
elif command == "S" and size > 1:
size -= 1
elif command == "E":
newsize = int(input("Enter a new size: "))
if newsize > 0:
size = newsize
else:
print("Error: Invalid size.")
input("(Press any key...)")
elif command == "D":
mode += 1
mode %= 3
elif command == "A":
mode -= 1
mode %= 3
if command in "WSE":
current = mpca.RasterCircle(size)
if modes[mode] == "n":
current.setASCII()
elif modes[mode] == "s":
current.setASCIIMinimal()
elif modes[mode] == "i":
current.setASCIIInverted()