From: Michael Neumann Date: 2003-06-02T23:02:07+09:00 Subject: Re: [OT] mandelbrot, was: Binary Tree vs. Hash On Mon, Jun 02, 2003 at 09:22:07AM +0900, Wojciech Kaczmarek wrote: > Mon, 26 May 2003 18:54:24 +0900, Michael Neumann wrote: > [snip Array lookup problem] > > > ruby -r complex -e 'c,m,w,h=Complex(-0.75,0.136),50,150,100;puts "P6\n#{w} > > #{h}\n255";(0...h).each{|j|(0...w).each{|i| > > n,z=0,Complex(.9*i/w,.9*j/h);while n<=m&&(z-c).abs<=2;z=z*z+c;n+=1 end;print > > [10+n*15,0,rand*99].pack("C*")}}'|display > > Now that is a nice hack. And you've just reminded me about a bunch of > unwritten fractal-related small apps I planned to recode in Ruby. Thank you > :-> You can find the expanded, more verbose source code here: http://www.ntecs.de/blog/Tech/ComputerScience/JuliaSets.html Regards, Michael