Crunchy Frog Editor Test

Here's a canvas, try running the code supplied (should draw the mandelbrot set):

def mandel(x, y, maxiter = 20):
    c = complex(x, y)
    z = complex(0, 0)
    for k in range(maxiter):
        z = z*z + c
    if abs(z) < 2.0:
        return True
    else:
        return False

X = 100.0
Y = 100.0
for x in range(1,int(X)):
    for y in range(1,int(Y)):
        if mandel(x*3.0/X - 2.0, y*2.0/Y - 1.0):
            point(3*x,3*y)

Actually, thats a terrible test; try this instead:

circle((100, 100), 50)
set_line_colour('red')   # Canadian/British spelling for "colour"
circle((100, 100), 30)
set_line_color('green')  # American spelling for "color"
circle((100, 100), 10)

filled_circle((200, 200), 50)
set_fill_colour('yellow')
filled_circle((200, 200), 40)

width, height = 20, 10
rectangle((10, 10), width, height)
filled_rectangle((10, 25), width, height)

set_line_colour('blue')
line((40, 40), (50, 50))

triangle((20, 300), (40, 310), (30, 290))
set_fill_colour('salmon')
filled_triangle((20, 320), (40, 330), (30, 300))

set_line_colour('black')
point(200, 200)

This is what it should look like (except that the dot in the middle of the yellow circle should be smaller):

If you can't see this image, then image loading is broken!

Back to the test index