Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: do I win the "most pointless use of ZSH" award? ;)



On Apr 30,  9:05pm, Alan Third wrote:
> 
> 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... :)

Just one thing:

> #!/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

      echo

> done

With that echo inserted, one can do e.g.

	COLUMNS=60 LINES=20 zmandel

(or whatever you've called this) to draw the set smaller than the actual
screen size.



Messages sorted by: Reverse Date, Date, Thread, Author