Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Re: (Golf) Mandelbrot Fractal

by YuckFoo (Abbot)
on May 08, 2002 at 19:11 UTC ( [id://165139]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: (Golf) Mandelbrot Fractal
in thread (Golf) Mandelbrot Fractal

Knock off a couple more. 26 iterations is plenty, so a..iv can be a..z. Also ($m=$r*$r)>4 is a sufficient test, so
($m=$r*$r)+($n=$z*$z)>4 #becomes: $n=$z*$z,($m=$r*$r)>4

YuckFoo

Update: Thanks belg4mit, changed semi-colon to comma to work in demerphq's code which becomes:

map{$i=$_/20-1;map{$r=$j=$_/20-2.3;$z=$i;$b=$";$n=$z*$z,($m=$r*$r)>4 ?$b="+":($z=2*$r*$z+$i,$r=$m-$n+$j)for a..z;print$b}0..59;print$/}0..3 +9

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: (Golf) Mandelbrot Fractal
by belg4mit (Prior) on May 08, 2002 at 20:10 UTC
    Your change in the test doesn't work with demerphq's code. It does work in my 146 though (for a total of 143).
    map{$i=$_/20-1;map{$r=$j=$_/20-2.3;$z=$i;$b=$";$n=$z*$z;($m=$r*$r)>4? $b="+":($z=2*$r*$z+$i,$r=$m-$n+$j)for a..z;print$b}0..59;print$/}0..39 __END__ ++++++++++++++++++++++++++ +++++++ +++++++++++++++++ ++++++++ ++++++++++++ + +++++++++ ++++++++++ ++++++++++ ++++++++ +++++++++++ ++++++ ++++++++++++ +++ +++++++++++++ ++++++++++++++ + ++++++++++++ ++ ++++++++++ +++ ++++++++++ ++++ ++++++++ + +++++ +++++++++ ++++++ ++++++++ ++++++ ++++++++ +++++++ +++++++ +++++++ +++++++ ++++++++ ++++++ ++++++++ ++++++ ++++++++ ++++++ ++++++++ ++++++ ++++++++ ++++++ ++++++++ +++++++ ++++++++ +++++++ +++++++ ++++++++ +++++++ ++++++++ ++++++ +++++++++ ++++++ ++++++++ + +++++ ++++++++++ ++++ ++++++++++ +++ ++++++++++++ ++ ++++++++++++++ + +++++++++++++ ++++++++++++ +++ +++++++++++ ++++++ ++++++++++ ++++++++ +++++++++ ++++++++++ ++++++++ ++++++++++++ + +++++++ +++++++++++++++++

    --
    perl -pew "s/\b;([mnst])/'$1/g"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://165139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-24 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found