The reversed program (now in full color)
"-|=I+X#.";eval reverse';)1,52,1,2,2,32,97(=)i$,n$,z$,h$,w$,H$,W$(;".#X+I=|-"
';while(@ARGV){${pop@ARGV}=pop}do{while(/([a-z])\s*([-\d.]*)/cgi){${$1}=$2if$1}
$e=$_;$_=qq#'<$W%;<$H%(<$j%[<$w%|<$h%!<$x%=<$y}_<$A%^<$a%*<$z%:<$n\n]@//^:")%#;
@c=split//,$00;for(1..$i){$w*=$z;$h*=$z;$A+=$a;for(0..$H*$W-1){($U,$R,@0)=(f($_
%$W,int$_/$W),$n);($p,$q)=($j?($x,$y):(#(:)y$,x$(?j$(=)q$,p$(;)n$,)W$/_$tni,W$%
$U,$R));do{($U,$R)=($U*$U-$R*$R+$p,$U*2*$R+$q)}until(($U*$U+$R*$R>4)||--$0[0]==
0);print$c[int($0[0]*9/$n)],++$_%$W?$# : #$?W$%_$++,])n$/9*]0[0$(tni[c$tnirp;)0
"\n"}};sub f{($w/$W*($_[0]-($W-1)/2)*cos($A)+$h/$H*(($H-1)/2-$_[1])*sin($A)+$x,
($_[0]-($W-1)/2)*-$w/$W*sin($A)+$h/$H*(#(*H$/h$+)A$(nis*W$/w$-*)2/)1-W$(-]0[_$(
($H-1)/2-$_[1])*cos($A)+$y)};exit if$e=~/q/;BEGIN{push@ARGV,split' ',$ENV{TPJ}}
;s/}/%X<$X%Y<$Y%/;y"=_!'<%:/;[^]@|*)\"({"yAxW= nmHwaCohz:dju";print}while(<>)#}
Here is what the first line of this colorful program does:
- Reverse ;)1,52,1,2,2,32,97(=)i$,n$,z$,h$,w$,H$,W$(;".#X+I=|-"
- (Notice the string ending on the beginning of line 2.)
- Eval "-|=I+X#.";($W,$H,$w,$h,$z,$n,$i)=(79,23,2,2,1,25,1);
- This sets the default variables (for information):
- $x: x-coordinate of the center of the screen (default: 0)
- $y: y-coordinate of the center of the screen (default: 0)
- $W: width of the output in characters (default: 79)
- $H: height of the output in characters (default: 23)
- $w: width of the printed screen (in real coordinates) (default: 2)
- $h: height of the printed screen (in real coordinates) (default: 2)
- $j: if non-zero, the printed image is the Julia set of parameter (x,y) (default: 0)
- $X: x-coordinate of the center of the screen when displaying a Julia set (default: 0)
- $Y: y-coordinate of the center of the screen when displaying a Julia set (default: 0)
- $A: absolute rotation angle of the image (default: 0)
- $a: relative rotation angle between the image and the next (default: 0)
- $z: zooming factor between two images (default: 1)
- $n: number of iterations for the calculation (default: 25)
- (Note that on line 2 $2if$1 should read
$2if$1,
but perltidy decided otherwise.)
Previous | Next
Copyright © 2000-2001, Philippe "BooK" Bruhat.