I coded a progress indicator in the form of a falling deck of cards (my wife's idea).
It's not in its final form yet. Here is the code:
vdeck="| | | | | "
hdeck[1]="__ | | | |"
hdeck[2]="__ __ | | |"
hdeck[3]="__ __ __ | |"
hdeck[4]="__ __ __ __ |"
hdeck[5]="__ __ __ __ __"
while true
do
clear
echo -n -e "\r$vdeck"
sleep 0.8
for i in 1 2 3 4 5
do
echo -n -e "\r${hdeck[$i]}"
sleep 0.2
done
clear
done
Is it possible to optimize this code without having a hdeck array and getting the same effect? Increasing '|' means increasing the 'hdeck' array combinations, which isn't good.