Draws a Mandelbrot fractal in the terminalfor ($k = 1.2 ;$k >- 1.2 ;$k-=(2.4 )/40){ for ($j=-2.1 ;$j <.7 ;$j +=2.8 /100) {($x, $y, $i )=($j, $k, 0); + while (sqrt( $x** 2+$y + **2) <2 && $i<200) {($x ,$y )=( $x**2 -$y** 2+ $j,2 *$x*$y +$k ) ;$i++ ;} print ($i <12?( $i <4?($i <2? '#': + '%'): ($i <8?'&' :'*' )): ($i<50 ?($i <20? '+':'-') :( $i<80?',' :($i< 190 ?'.':' ') ))) ;} print"\n" ;}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fractal Generator
by liverpole (Monsignor) on Aug 15, 2007 at 15:36 UTC | |
|
Re: Fractal Generator
by dbw (Beadle) on Aug 15, 2007 at 16:14 UTC | |
|
Re: Fractal Generator
by Argel (Prior) on Aug 15, 2007 at 23:17 UTC | |
by my $self (Acolyte) on Aug 16, 2007 at 15:33 UTC | |
by Argel (Prior) on Aug 20, 2007 at 19:00 UTC |