How to resolve the algorithm Mandelbrot set step by step in the MiniScript programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Mandelbrot set step by step in the MiniScript programming language
Table of Contents
Problem Statement
Generate and draw the Mandelbrot set.
Note that there are many algorithms to draw Mandelbrot set and there are many functions which generate it .
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Mandelbrot set step by step in the MiniScript programming language
Source code in the miniscript programming language
ZOOM = 100
MAX_ITER = 40
gfx.clear color.black
for y in range(0,200)
for x in range(0,300)
zx = 0
zy = 0
cx = (x - 200) / ZOOM
cy = (y - 100) / ZOOM
for iter in range(MAX_ITER)
if zx*zx + zy*zy > 4 then break
tmp = zx * zx - zy * zy + cx
zy = 2 * zx * zy + cy
zx = tmp
end for
if iter then
gfx.setPixel x, y, rgb(255-iter*6, 0, iter*6)
end if
end for
end for
You may also check:How to resolve the algorithm A+B step by step in the NS-HUBASIC programming language
You may also check:How to resolve the algorithm Search a list step by step in the E programming language
You may also check:How to resolve the algorithm Terminal control/Dimensions step by step in the PureBasic programming language
You may also check:How to resolve the algorithm Sum of a series step by step in the EchoLisp programming language
You may also check:How to resolve the algorithm Balanced brackets step by step in the Batch File programming language