in reply to Fractal Golf anyone?
I can only see small improvements, but of course, in golf, everything counts!
Change your while loops and for loops to redo blocks and maps, for starters. Use special variables wherever possible, like $" instead of " ", and $/ instead of "\n". Get rid of all ; characters at the end of blocks.
Here's what I came up with so far:
$a=1;{ $b=-2; { $c='X'; $d=$b; $e=$a; map{ $g=$d; $d=$d**2-$e**2+$b; $e=2*$g*$e+$a; $c=$"if$d**2+$e**2>4 }1..50; print$c; $b+=.05; $b<1&&redo } print$/; $a-=0.1; $a>-1&&redo }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Fractal Golf anyone? (Embed assignments)
by ikegami (Patriarch) on Nov 28, 2006 at 18:03 UTC | |
|
Re^2: Fractal Golf anyone?
by Melly (Chaplain) on Nov 28, 2006 at 17:26 UTC | |
|
Re^2: Fractal Golf anyone?
by cLive ;-) (Prior) on Nov 28, 2006 at 22:58 UTC |