Eros, Rob, Peter and John,
Thanks for the feedback!
@Peter:
Your code does run fast. However, the colors don't seem to be correct. Please see the attached snapshots for my TB code and your O2 code. That's because TB arrays are always Option Base 1 and your code seems to use Option Base 0 and thus has the colors shifted up by one. You have to change
...
SetPixel hDC, iX, iY, colors(MIterate(cx, cy) + 1)
...
colors(j * wid + i + 1) = Rgb(r, g, b)
...
colors(MaxIters + 2) = 0
...
to
...
SetPixel hDC, iX, iY, colors(MIterate(cx, cy))
...
colors(j * wid + i) = Rgb(r, g, b)
...
colors(MaxIters + 1) = 0
...
to have the black spike on the left side of the fractal drawn exactly as TB draws it.
@John:
No, it won't be faster in a genuine Windows environment because the code uses an ordinary SetPixel() WinAPI to plot the pixels. Your Toshiba's CPU uses hardware virtualization for GDI calls under Wine so the difference will most probably be undetectable. OTOH plotting would be slower if done in Wine's DirectX or OpenGL (= wrapper around Wine's DirectX) because modern nVidia and ATI drivers and Windows sources are closed and your Linux fellows have so far been unable to crack their hardware acceleration technologies, well, mostly.
[EDIT]
@Rob:
Oh, I forgot to answer your question. FBSL's BASIC has usual "eager" (a.k.a. "inclusive") And and Or as well as their "lazy" (a.k.a. "exclusive", a.k.a. "short-circuited") AndAlso and OrElse equivalents for lazy evaluation.
FBSL's DynC has naturally lazy && and || logic operators only.
Bookmarks