From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11156 invoked from network); 30 Apr 2001 20:05:45 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Apr 2001 20:05:45 -0000 Received: (qmail 2394 invoked by alias); 30 Apr 2001 20:05:29 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3841 Received: (qmail 2379 invoked from network); 30 Apr 2001 20:05:28 -0000 Date: Mon, 30 Apr 2001 21:05:17 +0100 From: Alan Third To: zsh-users@sunsite.dk Subject: Re: do I win the "most pointless use of ZSH" award? ;) Message-ID: <20010430210517.A4840@idiocy.org> Mail-Followup-To: Alan Third , zsh-users@sunsite.dk References: <20010427213108.A28356@idiocy.org> <20010430124125.A2527@pianosa.catch22.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <20010430124125.A2527@pianosa.catch22.org>; from dbt@meat.net on Mon, Apr 30, 2001 at 12:41:25PM -0700 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