Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: do I win the "most pointless use of ZSH" award? ;)
- X-seq: zsh-users 3841
- From: Alan Third <alan@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: do I win the "most pointless use of ZSH" award? ;)
- Date: Mon, 30 Apr 2001 21:05:17 +0100
- In-reply-to: <20010430124125.A2527@xxxxxxxxxxxxxxxxxxx>; from dbt@xxxxxxxx on Mon, Apr 30, 2001 at 12:41:25PM -0700
- Mail-followup-to: Alan Third <alan@xxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010427213108.A28356@xxxxxxxxxx> <20010430124125.A2527@xxxxxxxxxxxxxxxxxxx>
On Mon, Apr 30, 2001 at 12:41:25PM -0700, David Terrell wrote:
> www.meat.net/~dbt/zsh-overkill2.png
>
> time says:
> ./bin/mandelbrot.zsh 65983.75s user 2255.87s system 31% cpu 59:51:22.92 total
> % echo $LINES $COLUMNS
> 360 1000
Hi, just for what it's worth, with the help of Bart Schaefer I've
managed to optimise the code a bit! It also looks a bit more
interesting whilst it's drawing than before... :)
#!/bin/zsh
((columns=COLUMNS-1, lines=LINES))
((colour=0))
for ((b=-1.5;b<=1.5;b+=3.0/lines));do
for ((a=-2.0;a<=1;a+=3.0/columns));do
for (( p=0.0, q=0.0, i=0 ; p*p+q*q < 4 && i < 32 ; i++));do
((pnew=p*p-q*q+a, q=2*p*q+b, p=pnew))
done
((colour=(i/4)%8))
echo -n "\\e[4${colour}m "
done
done
--
Alan Third
Messages sorted by:
Reverse Date,
Date,
Thread,
Author