Created
November 5, 2020 18:05
-
-
Save naus3a/5f337e7d6bf9c18a5a745809cac2b0ea to your computer and use it in GitHub Desktop.
bash Conway glider spinner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
frames=("⠢⠇" "⠨⠖" "⠬⠆" "⠐⡴" "⠢⠇" "⠨⠖" "⠬⠆" ".." "⣤ ") | |
nFrames=${#frames[@]} | |
curFrame=0 | |
frameTime=0.2 | |
printf " " | |
while true; do | |
printf "\033[2D${frames[$curFrame]}" | |
curFrame=$[$curFrame+1] | |
if [ $curFrame -ge $nFrames ]; then | |
curFrame=0 | |
fi | |
sleep $frameTime | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment