forked from TigerhawkT3/small_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvintage_media_whitespace.py
45 lines (45 loc) · 1.66 KB
/
vintage_media_whitespace.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
expression = [None for shapes in[{
'cassette':[' ______________ ',
'| __ __ |',
'| / \ / \ |',
'| \__/ \__/ |',
'| __________ |',
'|_/_O______O_\_|'],
'vhs':[' ______________________ ',
'| | ',
'| ____________ | ',
'| / | | \ | ',
'| | | | | | ',
'| \__|______|__/ | ',
'||____________________|| ',
'|______________________| '],
'floppy':[' _____________ ',
'|| | _ | | ',
'|| | | || | ',
'|| | |_|| | ',
'||___|______| | ',
'| ___________ | ',
'|| | | ',
'|| | | ',
'|| | | ',
'||___________|_| '],
'snes':[' _____________ ',
' __|| ||__ ',
'|__|| ||__| ',
'|__||___________||__| ',
'|__| ___________ |__| ',
'|__|| ||__| ',
'|__||___________||__| ']}]
for rows, columns, shape, square, upper, left in
((*map(int, rc), shapes[s], o not in ('ul', 'ur', 'll', 'lr'), o[0] == 'u', o[1:2] == 'l')
for *rc, s, o in map(str.split, map(str.lower, iter(lambda: 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'''), ''))))
for row in range(rows)
for line in shape if
print(
line*columns
if square
else
f'{line*min(columns, rows*upper + ((-1)**upper)*row + (not upper)):{"><"[left]}{len(line)*columns}}')]