I'm trying to get ChatGPT to make code that displays the Mandelbrot fractal on the Classpad II cp400, but cant get it to work:
PROGRAM Fractal
ClrText
local xmax=2.0, xmin=-2.0, ymax=1.5, ymin=-1.5
local x, y, zx, zy, cx, cy, tmp
local max_iter = 100
local color
For x = 0 To 319 Step 1
For y = 0 To 239 Step 1
cx = xmin + (x / 320.0) * (xmax - xmin)
cy = ymin + (y / 240.0) * (ymax - ymin)
zx = 0.0
zy = 0.0
color = 0
For iter = 0 To max_iter Step 1
tmp = zx * zx - zy * zy + cx
zy = 2.0 * zx * zy + cy
zx = tmp
If zx * zx + zy * zy > 4.0 Then
Exit
EndIf
Next
If color = max_iter Then
color = 0
EndIf
SetPixel color, x, y
Next
Next
DispGraph
EndPrgm