pxh

Obfuscated Mandelbrot set generator

pxh
Jun 14th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.14 KB | None | 0 0
  1.                                                                             (
  2.  
  3.  
  4.                                                                        $w,
  5.                                                                    $a)=@ARGV
  6.                                                                   ;$w-=$w%12
  7.                                                                    ;open($f,
  8.                                                                      '>',
  9.                                                         $a    );binmode$f;$|=1;$z=
  10.                                                         16384;@g=(" Done!\n","Gene".  "r"
  11.                                                        ."ating fractal with dimensions "
  12.                                                    .  $w." by ".2/3*$w."...\n","\nSavin".
  13.                                                     "g fractal to ".$a."...");print$f 'BM'
  14.                                                    .pack('VVVVvvvv',$w*$w*2+26,$n,26,12,$w,$w
  15.                                                    *2/3,1,24);sub a{($r,$i,$x,$y,$j,@s)=@_;
  16.                                 ;;  return        $z if(($r+1)**2+$i*$i<1/16||(($r-1/4)**2+
  17.                                  $i*$i)*((($r    -1/4)**2+$i*$i)+($r-1/4))<1/4*$i*$i or!$i&&
  18.                               abs($r+1)<1);do{  return $j-log(log($x*$x+$y*$y)*0.5/log(2))/
  19.                               log(2)if((push@s,($x,$y))&&$x*$x+$y*$y>36);$t=1;($x,$y)=($r+
  20.                          $x* $x-$y*$y,$i+2*$x*$y);if($j%int($z/11)==0&&$j){for(@s){return
  21. $z if($s[$j-$t++]eq$s[$j])}}}while($j++<$z);return$z}$u.=' 'while($o++<51);print$g[1].
  22.                          $u. "]\r[";do{if(($k-1)/($w*($w/3+1))<$n&&$k/($w*($w/3+1))>=$n){
  23.                               $n+=0.02;print'='}$h=4;$v[$k]+=a(3.7*($k%$w+int($h/3)/3)/$w-
  24.                               2.6,3.7*(int($k/  $w)+($h--%3-1)/3)/$w)/9 while($h>-5)}while(
  25.                                  $k++<$w*($w/    3+1));print$g[2];print$f pack('ccc',(($z-$p
  26.                                 )/  $z-2**        -($p-2.8))*64*(sin(1.1+log($p)*4)-sin(log
  27.                                                    ($p)*8+1.1)/3+5/3),(($z-$p)/$z-2**-($p-
  28.                                                     2.8))*64*(sin(log($p)*4-1.1)+sin(log($p)
  29.                                                      *8-1.1)/3+5/3),2*(($z-$p)/$z-2**-($p
  30.                                                    -  2.8))*63.5*(sin(log($p)*4-1.25)+1)
  31.                                                         )while(($p=$v[abs($w/3-int($l/$w
  32.                                                         ))*$w+$l++%$w]+2.8)-2.8);;;;  ;;;
  33.                                                         ;;    close$f;;#MANDELBROT
  34.                                                                      #SET
  35.                                                                    #K.STREHL
  36.                                                                   06/14/2015
  37.                                                                    ;;print$g
  38.                                                                        [0
  39.  
  40.  
  41.                                                                             ]
Advertisement
Add Comment
Please, Sign In to add comment