Using the "native" complex numbers in C.Basic makes the code much simpler and faster
This is the code I have for my fx-9750GII (Monochrome)
CASIO Basic
#Program name: Mndelbrt
#Password: <no password>
1 / 32 -> S
ViewWindow ﹣2 + S, 2 - S, 0, ﹣1 + S, 1 - S, 0, 0, 1, 1
AxesOff : LabelOff
BG-None : PlotOff 0, 0
Do : LpWhile GetKey
For ﹣2 -> X To 2 Step S
For ﹣2 -> Y To 0 Step S
0 -> A : 0 -> B
For 1 -> I To 16
A² -> C : B² -> D
C + D > 4 => Break
2AB + Y -> B
C - D + X -> A
Next
If I > 20 :Then
PlotOn X, ﹣Y :
PlotOn X, ﹣Y
IfEnd
Next
Next
PlotChg 0, 0
C.Basic (Complex numbers)
#Program name: MndlbrtI
#Password: <no password>
'#CBcplx
1 / 32 -> S
ViewWindow ﹣2 + S, 2 - S, 0, ﹣1 - S, 1 - S, 0, 0, 1, 1
AxesOff : LabelOff
BG-None : PlotOff 0, 0
Do : LpWhile GetKey
For ﹣2 -> X To 2 Step S
For ﹣1 -> Y To 0 Step S
0 -> Z : X + Yi -> C
For 1 -> I To 20
Z² + C -> Z
Abs Z > 2 => Break
Next
If I > 50 :Then
PlotOn X, ﹣Y :
PlotOn X, ﹣Y
Break
IfEnd
Next
Next
PlotChg 0, 0
Mandelbrot Basic.zip |