summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2023-07-02 06:29:14 -0700
committerHaoran S. Diao (刁浩然) <0@hairydiode.xyz>2023-07-02 06:29:14 -0700
commitf05aeceacab864d2f34b21074f501a00a0dcf8b8 (patch)
treee2591826d371de80855a2d4834d8857a6a3db028
parent9aee1bd8d90cb9ee252aa27dcc106e5991bc8cb3 (diff)
Even more optimization
-rwxr-xr-xbbrll6
1 files changed, 3 insertions, 3 deletions
diff --git a/bbrll b/bbrll
index 5f3324f..13fd5f7 100755
--- a/bbrll
+++ b/bbrll
@@ -53,7 +53,8 @@ function print_sin_braille() {
#6 7
#reverse
#(1,3)(0,3)(1,2)(1,1)(1,0)(0,2)(0,1)(0,0)
- num=0
+ #the braille empty char in decimal base
+ num=14852224
if [ "${rawbuff[((0+4*$2))]:((0+2*$1)):1}" == "1" ]; then
num=$(($num + 1))
fi
@@ -81,8 +82,7 @@ function print_sin_braille() {
#ors it with the utf-8 hex value of the empty braille character
#the two spaces assume aht the encoding is utf-8, convoluted bitwise OR
#and coversion between character and number stuff
- #echo "obase=16;$(( 2#$b7${b6}00$b5$b4$b3$b2$b1$b0 | 0xE2A080 ))"|bc | xxd --reverse -ps
- echo "obase=16;$(( $num | 0xE2A080 ))"|bc | xxd --reverse -ps
+ printf %x $num | xxd --reverse -ps
}
function print_braille() {