> 
mandelbrot := proc(x, y)

> 
for m from 0 to 30 while abs(z) < 2.0 do

> 
plot3d(0, 2 .. 0.7, 1.2 .. 1.2, orientation=[90,0], grid=[200, 200], scaling=constrained, style=patchnogrid, lightmodel=none, color=[((x,y)>mandelbrot(x,y)/30.0), 1, 1, colortype=HSV]);

> 
plot3d(0, 2 .. 0.7, 1.2 .. 1.2, orientation=[90,0], grid=[200, 200], scaling=constrained, style=patchnogrid, lightmodel=none, color=[((x,y)>mandelbrot(x,y)/30.0), 1, ((x,y)>30mandelbrot(x,y)), colortype=HSV]);

> 
p1,p2,p3 := 23,5,2: plot3d(0, 2 .. 0.7, 1.2 .. 1.2, orientation=[90,0], grid=[200, 200], scaling=constrained, style=patchnogrid, lightmodel=none, color=[((x,y)>irem(mandelbrot(x,y),p1)), ((x,y)>irem(mandelbrot(x,y),p2)), ((x,y)>irem(mandelbrot(x,y),p3)), colortype=RGB]);

> 
mandelbrot2 := proc(x, y) option remember,system, hfloat;

> 
for m from 0 to 30 while abs(z) < 2.0 do

> 
m, abs(z); # no longer evalhfable, as is

> 
plot3d(0, 2 .. 0.7, 1.2 .. 1.2, orientation=[90,0], grid=[200, 200], scaling=constrained, style=patchnogrid, lightmodel=none, color=[((x,y)>mandelbrot2(x,y)[1]/30.0), 1, ((x,y)>mandelbrot2(x,y)[2]), colortype=HSV]);

