forked from TigerhawkT3/small_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvintage_media_multiline.py
50 lines (50 loc) · 1.99 KB
/
vintage_media_multiline.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
items = {'cassette':[' ______________ ',
'| __ __ |',
'| / \ / \ |',
'| \__/ \__/ |',
'| __________ |',
'|_/_O______O_\_|'],
'vhs':[' ______________________ ',
'| | ',
'| ____________ | ',
'| / | | \ | ',
'| | | | | | ',
'| \__|______|__/ | ',
'||____________________|| ',
'|______________________| '],
'floppy':[' _____________ ',
'|| | _ | | ',
'|| | | || | ',
'|| | |_|| | ',
'||___|______| | ',
'| ___________ | ',
'|| | | ',
'|| | | ',
'|| | | ',
'||___________|_| '],
'snes':[' _____________ ',
' __|| ||__ ',
'|__|| ||__| ',
'|__||___________||__| ',
'|__| ___________ |__| ',
'|__|| ||__| ',
'|__||___________||__| ']}
while 1:
i = input('''Enter rows, columns, shape (cassette, VHS, floppy, SNES),
and orientation (square, UR, UL, LR, LL) separated by space,
or leave blank to exit:\n''')
if not i:
break
*rc, shape, orientation = i.lower().split()
rows, columns = map(int, rc)
shape = items[shape]
square = orientation not in ('ul', 'ur', 'll', 'lr')
upper = orientation[0] == 'u'
left = orientation[1:2] == 'l'
for row in range(rows):
for line in shape:
if square:
print(line*columns)
else:
content = line * min(columns, rows*upper + ((-1)**upper)*row + (not upper))
print(f'{content:{"><"[left]}{len(line)*columns}}')