← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/render.sh
diff options
context:
space:
mode:
authorr4tss <[email protected]>2021-04-22 08:57:10 +0200
committerr4tss <[email protected]>2021-04-22 08:57:10 +0200
commit37c22e7545655a6b8169279a085d15a38cfa05f9 (patch)
tree233c473493d48ffbf0a29924bda26d79b9f0c063 /render.sh
parent4f7d2dc2d5c7329acc7ee4ff4695ec423ab01f82 (diff)
did stuff
Diffstat (limited to 'render.sh')
-rwxr-xr-xrender.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/render.sh b/render.sh
new file mode 100755
index 0000000..d686f40
--- /dev/null
+++ b/render.sh
@@ -0,0 +1,43 @@
+#!/bin/zsh
+W=0
+H=0
+height=0
+
+echo ${distance[1]}
+
+function a { #input format: distance, height, invert
+ if [ $(echo "$(sed -n $(echo $((W + 1))p) distances) < ($height * 0.75)" | bc) -eq 1 ]
+ then
+ b="#"
+ elif [ $H -gt 20 ]
+ then
+ b="-"
+ else
+ b=" "
+ fi
+}
+
+while [ $H -lt 41 ]
+do
+ echo
+ while [ $W -lt 91 ]
+ do
+ a
+ if [ $W -eq 90 ]
+ then
+ echo $b
+ else
+ echo -n $b
+ fi
+ echo -n " "
+ ((W++))
+ done
+ ((H++))
+ if [ $H -lt 21 ]
+ then
+ ((height++))
+ else
+ ((height--))
+ fi
+ W=0
+done