Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
45
Task/Mandelbrot-set/Craft-Basic/mandelbrot-set.basic
Normal file
45
Task/Mandelbrot-set/Craft-Basic/mandelbrot-set.basic
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
define max = 15, w = 640, h = 480
|
||||
define py = 0, px = 0, sx = 0, sy = 0
|
||||
define xx = 0, xy = 0
|
||||
|
||||
bgcolor 0, 0, 0
|
||||
cls graphics
|
||||
fill on
|
||||
|
||||
do
|
||||
|
||||
let px = 0
|
||||
|
||||
do
|
||||
|
||||
let sy = (py - h / 2) / 150
|
||||
let sx = (px - w / 2) / 150
|
||||
|
||||
let i = 0
|
||||
let x = 0
|
||||
let y = 0
|
||||
|
||||
let xy = x * x + y * y
|
||||
|
||||
do
|
||||
|
||||
let xx = x * x - y * y + sx + .1
|
||||
let y = 2 * x * y + sy
|
||||
let x = xx
|
||||
|
||||
let i = i + 1
|
||||
|
||||
loop i < max and xy < 4
|
||||
|
||||
wait
|
||||
|
||||
fgcolor 220 + i * x, 220 + i * y, 230 + i * xy
|
||||
rect px, py, 4, 4
|
||||
|
||||
let px = px + 4
|
||||
|
||||
loop px < w
|
||||
|
||||
let py = py + 4
|
||||
|
||||
loop py < h
|
||||
Loading…
Add table
Add a link
Reference in a new issue