Created
April 14, 2014 17:01
-
-
Save gleero/10665416 to your computer and use it in GitHub Desktop.
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 | |
################################# | |
str="Привет, наркомания" | |
################################# | |
# Карта цветов | |
len=`echo $str | wc -c` | |
for step in `seq $len`; do | |
let "color = $RANDOM % 16" | |
map="$map $color" | |
done | |
# Хуячим бесконечно | |
while [ 1 ]; do | |
# Рендерим | |
i=0 | |
> "/tmp/.tqkgpgq" | |
grep -o . <<< "$str" | while read letter; do | |
let "i += 1" | |
ret="`echo $map | cut -d ' ' -f$i`" | |
echo -n "`tput setaf $ret`$letter" >> /tmp/.tqkgpgq | |
done | |
cat /tmp/.tqkgpgq | |
tput cub $len | |
# Обновляем карту цветов | |
let "color = $RANDOM % 16" | |
map="`echo $map | cut -d ' ' -f 2-` $color" | |
sleep .2 | |
done | |
rm /tmp/.tqkgpgq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment