in reply to Re: Fractal Golf anyone?
in thread Fractal Golf anyone?

Mmm, nice - I thought at first the list assignment for $d and $e was a false economy, but on closer inspection, it somehow avoids the need for a temporary value for $d - care to explain to an idiot? (I assume that the new value for $d is not used in the evaluation of $e)

($d, $e) = (2*$d*$e+$a, $e**2-$d**2+$b);
Tom Melly, tom@tomandlu.co.uk

Replies are listed 'Best First'.
Re^3: Fractal Golf anyone?
by ikegami (Patriarch) on Nov 29, 2006 at 15:52 UTC
    The RHS of the assignment is evaluated before either either $d or $e is changed. The intermediate value are saved on Perl's stack.

      Thanks for the heads-up. That's pretty much what I assumed, but it's nice to have it confirmed. I must admit I find precedence a nightmare, and tend to avoid coding that depends on it.

      map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e** 2-$d**2+$b);$c=$d**2+$e**2>4?_:0}1..99;print$c}0..59;print$/}0..20;
      Tom Melly, pm@tomandlu.co.uk