#!/usr/bin/perl
                                                                            (


                                                                       $w,
                                                                   $a)=@ARGV
                                                                   ;$w-=$w%12
                                                                   ;open($f,
                                                                     '>',
                                                        $a    );binmode$f;$|=1;$z=
                                                        16384;@g=(" Done!\n","Gene".  "r"
                                                       ."ating fractal with dimensions "
                                                   .  $w." by ".2/3*$w."...\n","\nSavin".
                                                    "g fractal to ".$a."...");print$f 'BM'
                                                   .pack('VVVVvvvv',$w*$w*2+26,$n,26,12,$w,$w
                                                   *2/3,1,24);sub a{($r,$i,$x,$y,$j,@s)=@_;
                                ;;  return        $z if(($r+1)**2+$i*$i<1/16||(($r-1/4)**2+
                                 $i*$i)*((($r    -1/4)**2+$i*$i)+($r-1/4))<1/4*$i*$i or!$i&&
                              abs($r+1)<1);do{  return $j-log(log($x*$x+$y*$y)*0.5/log(2))/
                              log(2)if((push@s,($x,$y))&&$x*$x+$y*$y>36);$t=1;($x,$y)=($r+
                         $x* $x-$y*$y,$i+2*$x*$y);if($j%int($z/11)==0&&$j){for(@s){return
$z if($s[$j-$t++]eq$s[$j])}}}while($j++<$z);return$z}$u.=' 'while($o++<51);print$g[1].
                         $u. "]\r[";do{if(($k-1)/($w*($w/3+1))<$n&&$k/($w*($w/3+1))>=$n){
                              $n+=0.02;print'='}$h=4;$v[$k]+=a(3.7*($k%$w+int($h/3)/3)/$w-
                              2.6,3.7*(int($k/  $w)+($h--%3-1)/3)/$w)/9 while($h>-5)}while(
                                 $k++<$w*($w/    3+1));print$g[2];print$f pack('ccc',(($z-$p
                                )/  $z-2**        -($p-2.8))*64*(sin(1.1+log($p)*4)-sin(log
                                                   ($p)*8+1.1)/3+5/3),(($z-$p)/$z-2**-($p-
                                                    2.8))*64*(sin(log($p)*4-1.1)+sin(log($p)
                                                     *8-1.1)/3+5/3),2*(($z-$p)/$z-2**-($p
                                                   -  2.8))*63.5*(sin(log($p)*4-1.25)+1)
                                                        )while(($p=$v[abs($w/3-int($l/$w
                                                        ))*$w+$l++%$w]+2.8)-2.8);;;;  ;;;
                                                        ;;    close$f;;#MANDELBROT
                                                                     #SET
                                                                   #K.STREHL
                                                                  06/14/2015
                                                                   ;;print$g
                                                                       [0


                                                                            ]
