mirror of https://dicksdeathabove.xyz/~mia/morsh
comment check added ...
This commit is contained in:
parent
0566ed32f5
commit
dc07f0d2af
24
morsh
24
morsh
|
@ -13,7 +13,7 @@ exb=".-:-...:-.-.:-..:.:..-.:--.:....:..:.---:-.-:.-..:--:-.:---:.--.:--.-:.-.:.
|
||||||
ma() {
|
ma() {
|
||||||
eval letter=\${$#}
|
eval letter=\${$#}
|
||||||
eval cur=\${$letter}; [ "$cur" = 37 ] && cur=" " # IFS=": " causes #37 in $index to be lost
|
eval cur=\${$letter}; [ "$cur" = 37 ] && cur=" " # IFS=": " causes #37 in $index to be lost
|
||||||
printf '%s' "$cur"
|
printf '%s' "${cur}"
|
||||||
}
|
}
|
||||||
|
|
||||||
am() {
|
am() {
|
||||||
|
@ -23,9 +23,28 @@ am() {
|
||||||
eval cur=\${$letter}; printf '%s ' "$cur"
|
eval cur=\${$letter}; printf '%s ' "$cur"
|
||||||
}
|
}
|
||||||
|
|
||||||
while read -r p || [ -n "$p" ]; do
|
unset bang; line=1; while read -r p || [ -n "$p" ]; do
|
||||||
p=${p# }; p=${p% }
|
p=${p# }; p=${p% }
|
||||||
|
[ "$line" -eq 1 -o "$bang" ] 2>/dev/null && { # start comment check # this is basically a shitpost lol
|
||||||
|
case "$p" in
|
||||||
|
'#'!*) bang=" ";;
|
||||||
|
'#'*) p="${p#\#}"; printf '%sl: %s\n#' "${bang# }" "${line}"
|
||||||
|
bang='
|
||||||
|
' # big hack to add newlines to start if >1
|
||||||
|
n1="0"; IFS=": "; for i in ${p}; do
|
||||||
|
for ii in $exb; do
|
||||||
|
: $((n1+=1));
|
||||||
|
case "$ii" in
|
||||||
|
"$i") ma ${index} "$n1"
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
n1=0
|
||||||
|
done ;;
|
||||||
|
esac # this only converts morse
|
||||||
|
[ "$bang" ] && unset p
|
||||||
|
}
|
||||||
case "$p" in
|
case "$p" in
|
||||||
|
#"") ;; # skip empty lines
|
||||||
-*|.*)
|
-*|.*)
|
||||||
# for morse to ascii
|
# for morse to ascii
|
||||||
n1="0"; IFS=": "; for i in ${p}; do
|
n1="0"; IFS=": "; for i in ${p}; do
|
||||||
|
@ -53,5 +72,6 @@ while read -r p || [ -n "$p" ]; do
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
: $((line+=1))
|
||||||
done # stdin read; fuck you
|
done # stdin read; fuck you
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue