shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] feet.sh


From: Valtoir S. Jardim
Subject: Re: [shell-script] feet.sh
Date: Sun, 29 Jul 2007 22:52:59 -0300 (BRT)
User-agent: SquirrelMail/1.4.6

Corrigindo o link:

http://dwarfurl.com/8f937

Agora sim :)

Valtoir

Em Dom, Julho 29, 2007 22:35, Valtoir S. Jardim escreveu:
>
> Olá, pessoal. Lembram do script "pes.sh", aquele dos pezinhos?
>
> http://www.mail-archive.com/address@hidden/msg06385.html
>
> Reescrevi todo ele, com um lógica diferente. Ficou mais enxuto (menos de
> 50 linhas) e mais randômico. Se alguém quiser baixar o arquivo prá não
> precisar copiar, colar e ajustar a identação, o link é
> http://dwarfurl.com/8f937.Segue o código:
>
> #!/bin/bash
> #  author: Valtoir dos Santos Jardim
> #  e-mail: valtoirjardim_at_gmail_dot_com
> #    blog: valtoir.blogspot.com
> #    date: 2007-07-29-21:28
> # version: ~ 0.99
> trap "" 2
> setterm -cursor off -bold on
> colors=(31 32 33 34 35 36 37)
> rfp=("+8" "+9" "+8" "+8")
> rfo=("(_/" ") /" "(   )" "Oooo.")
> lfp=("+2" "+1" "" "")
> lfo=("\_)" "\ (" "(   )" ".oooO")
> feet () {
>    while :; do
>       left_foot=$(($RANDOM % $((`tput cols` - 12)))) || exit -1
>       act_foot=$((RANDOM % 2))
>       color=${colors[$(($RANDOM % ${#colors[*]}))]}
>       seed=$((RANDOM % 4))
>       delay=.$(((RANDOM % 8) + 4))
>       actline=$(tput lines)
>       while :; do
>          for i in $(seq $seed 4); do
>             [ $((actline--)) -ge 1 ] || break
>             if [ $act_foot -eq 0 ]; then
>                tput cup $((actline)) $((left_foot ${rfp[$i]}))
>                echo -e "\e[$color;1m""${rfo[$i]}""\c\e[m"
>             else
>                tput cup $((actline)) $((left_foot ${lfp[$i]}))
>                echo -e "\e[$color;1m""${lfo[$i]}""\c\e[m"
>             fi
>          done
>          if [ $act_foot -eq 0 ]; then
>             act_foot=1
>          else
>             act_foot=0
>          fi
>       [ $actline -ge 1 ] || break
>          seed=0
>          sleep $delay
>       done
>    done
> }
> feet &
> read -rs -n 1
> echo -e "\e[m"
> setterm -reset
> clear
> pkill feet
>
>
> Isso aí.
>
> Abraços,
>
> Valtoir
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]