diff options
author | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2023-07-02 06:29:14 -0700 |
---|---|---|
committer | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2023-07-02 06:29:14 -0700 |
commit | f05aeceacab864d2f34b21074f501a00a0dcf8b8 (patch) | |
tree | e2591826d371de80855a2d4834d8857a6a3db028 /bbrll | |
parent | 9aee1bd8d90cb9ee252aa27dcc106e5991bc8cb3 (diff) |
Even more optimization
Diffstat (limited to 'bbrll')
-rwxr-xr-x | bbrll | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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() { |