-
Notifications
You must be signed in to change notification settings - Fork 0
/
font.sh
executable file
·184 lines (159 loc) · 4.02 KB
/
font.sh
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
#!/bin/bash
# for colorizing numbers
FONT_SH=1
font_c0="\e[m"
font_c1="\e[31m"
font_c2="\e[38;5;22m"
font_c3="\e[32m"
font_c4="\e[38;5;226m"
font_c5="\e[34m"
font_c6="\e[35m"
function font_map { # $1: val
case $1 in
0) zero;;
1) one;;
2) two;;
3) three;;
4) four;;
6) six;;
8) eight;;
10) ten;;
11) eleven;;
12) twelve;;
16) sixteen;;
32) thirtytwo;;
64) sixtyfour;;
128) onetwoeight;;
256) twofivesix;;
512) fiveonetwo;;
1024) onezerotwofour;;
2048) twozerofoureight;;
*) return 0;;
esac
return 1
}
function printer { # $1: value
for ((i=0; i<4; i++)); do
echo "${word[$i]}"
done
}
function zero {
word[0]=" ▗▄▄▄▖ "
word[1]=" █ █ "
word[2]=" █ █ "
word[3]=" ▀▀▀ "
}
function one {
word[0]=" ▗▄ "
word[1]=" █ "
word[2]=" █ "
word[3]=" ▀ "
}
function two {
word[0]=" ▃▄▄▃ "
word[1]=" ▝▘ ▄▀ "
word[2]=" ▄▀▀ "
word[3]=" ▀▀▀▀▀▀ "
}
function three {
word[0]=" ▗▄▄▄▖ "
word[1]=" ▄▀ "
word[2]=" ▗▖ ▜▖ "
word[3]=" ▝▀▀ "
}
function four {
word[0]=" ▄▆ "
word[1]=" ▄▀ █ "
word[2]=" ▀▀▀▀█▀ "
word[3]=" ▀ "
}
function six {
word[0]=" ▗▄▄▄▖ "
word[1]=" █▄▄▄ "
word[2]=" █ █ "
word[3]=" ▀▀▀ "
}
function eight {
word[0]=" ▄▄▄▄ "
word[1]=" █ ▂▃▄▀ "
word[2]=" ▄▀▔ █ "
word[3]=" ▀▀▀▀ "
}
function ten {
word[0]=" ▗▄ ▗▄▄▖ "
word[1]=" █ █ █ "
word[2]=" █ █ █ "
word[3]=" ▀ ▀▀ "
}
function eleven {
word[0]=" ▗▄ ▗▄ "
word[1]=" █ █ "
word[2]=" █ █ "
word[3]=" ▀ ▀ "
}
function twelve {
word[0]=" ▗▄ ▂▄▄ "
word[1]=" █ ▔ ▄█ "
word[2]=" █ ▃█▀ "
word[3]=" ▀ ▀▀▀▀ "
}
function sixteen {
word[0]=" ▗▄ ▗▄▄▖ "
word[1]=" █ █▄▄ "
word[2]=" █ █ █ "
word[3]=" ▀ ▀▀ "
}
function thirtytwo {
word[0]=" ▗▄▄▄▖▂▄▄ "
word[1]=" ▄▀ ▔ ▄█ "
word[2]=" ▗▖ ▜▖▃█▀ "
word[3]=" ▝▀▀ ▀▀▀▀ "
}
function sixtyfour {
word[0]=" ▗▄▄▖ ▄▄ "
word[1]=" █▄▄ ▄▀ █ "
word[2]=" █ █▝▀▀▀█▘"
word[3]=" ▀▀ ▀ "
}
function onetwoeight {
word[0]=" "
word[1]="▝▌▀▀▀▖▗▀▀▀▖"
word[2]=" ▌▄▀▀ ▗▀▀▀▖"
word[3]=" ▘▀▀▀▘▝▀▀▀ "
}
function twofivesix {
word[0]=" "
word[1]=" ▀▀▖▐▀▀▗▀▀ "
word[2]=" ▄▀ ▀▚▐▀▀▖"
word[3]=" ▀▀▘▝▀▘ ▀▀ "
}
function fiveonetwo {
word[0]=" "
word[1]="▐▀▀▀▝█ ▀▀▀▖"
word[2]=" ▀▀▄ █ ▄▀▀ "
word[3]="▝▀▀ ▀ ▀▀▀▘"
}
function onezerotwofour {
word[0]=" "
word[1]="${font_c2}▝▌${font_c1}▛▜${font_c5}▝▀▚${font_c6} ▞▌ "
word[2]="${font_c2} ▌${font_c1}▙▟${font_c5}▗▟▙${font_c6}▝▀▛ "
word[3]=" "
}
function twozerofoureight {
word[0]=" ${font_c3}▁▁ "
word[1]="${font_c1}▝▀▚${font_c4}▛▜${font_c5} ▞▌${font_c3}▙▟ "
word[2]="${font_c1}▗▟▙${font_c4}▙▟${font_c5}▝▀▛${font_c3}▙▟ "
word[3]=" "
}
if [ `basename $0` == "font.sh" ]; then
two; printer
#four; printer
eight; printer
#sixteen; printer
thirtytwo; printer
sixtyfour; printer
onetwoeight; printer
twofivesix; printer
fiveonetwo; printer
twozerofoureight; printer
fi