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

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

Re: [shell-script] Script Boas Festas


From: Julio C. Neves
Subject: Re: [shell-script] Script Boas Festas
Date: Wed, 12 Dec 2007 09:48:35 -0200

Aê Alan,

Depois da linha em que está escrito boas festas, inclua a seguinte:

tput cup $((lin+1)) $((c - 4)); echo A Fafism Deseja a todos um santo natal

Depois aumente o valor a ser subtraído de c (no exemplo acima é 4) para que
o texto fique centralizado.

Abraços,
Julio

Em 11/12/07, Alan Diones <address@hidden> escreveu:
>
>   Júlio, gostaria de adicionar mais duas linhas em baixo do boas festas,
> seguindo a mesma tabulação, uma linha trará a msg "A Fafism Deseja a
> todos um santo natal", como eu faço?
>
> obrigado
>
> Em Ter, 2007-12-11 às 18:54 -0200, Julio C. Neves escreveu:
>
> > Juro que essa é a última e não encho mais o saco
> >
> > $ cat natal.sh
> > #!/bin/bash
> > # Versão 2.0
> > trap "tput reset; exit" 2
> > clear
> > tput civis
> > lin=2
> > col=$(($(tput cols) / 2))
> > c=$((col-1))
> > est=$((c-2))
> > cor=0
> > tput setaf 2; tput bold
> > # Montando a Árvore
> > for ((i=1; i<20; i+=2))
> > {
> > tput cup $lin $col
> > for ((j=1; j<=i; j++))
> > {
> > echo -n \*
> > }
> > let lin++
> > let col--
> > }
> > tput sgr0; tput setaf 3
> > for ((i=1; i<=2; i++))
> > {
> > tput cup $((lin++)) $c
> > echo 'mWm'
> > }
> > tput setaf 1; tput bold
> > tput cup $lin $((c - 4)); echo BOAS FESTAS
> > let c++
> > k=1
> > # Pendurando as bolas (da árvore, claro!)
> > while true; do
> > for ((i=1; i<=25; i++))
> > {
> > # Apagando a bola que foi ligada há 25 rodadas atras
> > [ $k -gt 1 ] && {
> > tput setaf 2; tput bold
> > tput cup ${linha[$[k-1]$i]} ${coluna[$[k-1]$i]}; echo \*
> > unset linha[$[k-1]$i]; unset coluna[$[k-1]$i] # Mantenha limpo
> > o vetor
> > }
> > li=$((RANDOM % 9 + 3))
> > ini=$((c-li+2))
> > fim=$((c+li+2))
> > co=$((RANDOM % (li-2) * 2 + 1 + ini))
> > tput setaf $cor; tput bold # Troca cor das bolas
> > tput cup $li $co
> > echo o
> > linha[$k$i]=$li
> > coluna[$k$i]=$co
> > cor=$(((cor+1)%8))
> > sleep 0.2
> > }
> > let k++
> > done
> >
> > [As partes desta mensagem que não continham texto foram removidas]
> >
> >
> >
> >
> >
>
>  
>



-- 
Abraços,
Julio
Feliz Natal
:wq


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

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