From f05aeceacab864d2f34b21074f501a00a0dcf8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haoran=20S=2E=20Diao=20=28=E5=88=81=E6=B5=A9=E7=84=B6=29?= <0@hairydiode.xyz> Date: Sun, 2 Jul 2023 06:29:14 -0700 Subject: Even more optimization --- bbrll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bbrll') 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() { -- cgit v1.1