Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Mandelbrot-set/QBasic/mandelbrot-set.basic
Normal file
28
Task/Mandelbrot-set/QBasic/mandelbrot-set.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
SCREEN 13
|
||||
WINDOW (-2, 1.5)-(2, -1.5)
|
||||
FOR x0 = -2 TO 2 STEP .01
|
||||
FOR y0 = -1.5 TO 1.5 STEP .01
|
||||
x = 0
|
||||
y = 0
|
||||
|
||||
iteration = 0
|
||||
maxIteration = 223
|
||||
|
||||
WHILE (x * x + y * y <= (2 * 2) AND iteration < maxIteration)
|
||||
xtemp = x * x - y * y + x0
|
||||
y = 2 * x * y + y0
|
||||
|
||||
x = xtemp
|
||||
|
||||
iteration = iteration + 1
|
||||
WEND
|
||||
|
||||
IF iteration <> maxIteration THEN
|
||||
c = iteration
|
||||
ELSE
|
||||
c = 0
|
||||
END IF
|
||||
|
||||
PSET (x0, y0), c + 32
|
||||
NEXT
|
||||
NEXT
|
||||
Loading…
Add table
Add a link
Reference in a new issue