← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/render.sh
blob: 2933c3321714a36dc902d09d61ded58de7374645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/zsh
W=0
H=0
height=0

echo ${distance[1]}

function a {
	if [ $(echo "$(sed -n $(echo $((W + 1))p) distances) < ($height)" | 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
		if [ $H -eq 0 ]
		then
			echo -n " "
		else
			a
			if [ $W -eq 90 ]
			then
				echo $b
			else
				echo -n $b
			fi
			echo -n " "
		fi
		((W++))
	done
	((H++))
	if [ $H -lt 21 ]
	then
		((height++))
	else
		((height--))
	fi
	W=0
done