mandelbrot method

Preston Briggs preston at tera.tera.com
Fri Feb 6 21:55:42 UTC 1998


>Here is my method:

| c1 c2 x y x1 y1 r |
1 to: 300 do: [ :i |
        1 to: 150 do: [ :j |
                c1 := -2 + ((4*i)/300).
                          c2 := 2 - ((4*j)/300).
                          x :=c1.
                          y :=c2.
                                1 to: 30 do: [ :n |
                                        x1 :=(x*x)-(y*y)+c1.
                                        y1 :=(2*x*y)+c2.
                                        r :=(x1*x1)+(y1*y1).
                             (r < 4)
                                        ifTrue: [
                                                 x=x1.
                                                 y=y1.

                                self go: i @ j.
                                self goto: i @ (300-j).].

                                ]
                        ]
                ]

Glancing at it, I wonder about the lines

                                                 x=x1.
                                                 y=y1.

Probably want := instead of =

Preston





More information about the Squeak-dev mailing list