Last active
February 10, 2020 17:05
-
-
Save flxai/1b50bb06357f0e6d231695ab9c41f262 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Draws an endless carpet | |
# carpet [REPETITION] [FLICKER_MODE] | |
[[ $# -gt 0 ]] && s="$1" || s=4 | |
[[ $# -gt 1 ]] && m="$2" || m=0 | |
while :; do | |
if [[ -z "$b" ]]; then | |
p=$(pyceau -m "$m" -r 18+18 -d $(tput cols)x1 -s "$s") | |
else | |
p=$(pyceau -m "$m" -r 18+18 -d $(tput cols)x1 -s "$s" -b $b) | |
fi | |
b_="$b" | |
b=$(tail -1 <<< "$p" | awk '{ print $2 }') | |
c=$(grep -vE '([a-kn-z]|^$)' <<< "$p") | |
[[ "$b" == "$b_" ]] && continue | |
grep -qE '^(0+|1+)$' <<< "$b" && b="$b_" || echo "$c" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment