Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
69
Task/Mandelbrot-set/Dc/mandelbrot-set-1.dc
Normal file
69
Task/Mandelbrot-set/Dc/mandelbrot-set-1.dc
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
_2.1 sx # xmin = -2.1
|
||||
0.7 sX # xmax = 0.7
|
||||
|
||||
_1.2 sy # ymin = -1.2
|
||||
1.2 sY # ymax = 1.2
|
||||
|
||||
32 sM # maxiter = 32
|
||||
|
||||
80 sW # image width
|
||||
25 sH # image height
|
||||
|
||||
8 k # precision
|
||||
|
||||
[ q ] sq # quitter helper macro
|
||||
|
||||
# for h from 0 to H-1
|
||||
0 sh
|
||||
[
|
||||
lh lH =q # quit if H reached
|
||||
|
||||
# for w from 0 to W-1
|
||||
0 sw
|
||||
[
|
||||
lw lW =q # quit if W reached
|
||||
|
||||
# (w,h) -> (R,I)
|
||||
# | |
|
||||
# | ymin + h*(ymax-ymin)/(height-1)
|
||||
# xmin + w*(xmax-xmin)/(width-1)
|
||||
|
||||
lX lx - lW 1 - / lw * lx + sR
|
||||
lY ly - lH 1 - / lh * ly + sI
|
||||
|
||||
# iterate for (R,I)
|
||||
|
||||
0 sr # r:=0
|
||||
0 si # i:=0
|
||||
0 sa # a:=0 (r squared)
|
||||
0 sb # b:=0 (i squared)
|
||||
0 sm # m:=0
|
||||
|
||||
# do while m!=M and a+b=<4
|
||||
[
|
||||
lm lM =q # exit if m==M
|
||||
la lb + 4<q # exit if >4
|
||||
|
||||
2 lr * li * lI + si # i:=2*r*i+I
|
||||
la lb - lR + sr # r:=a-b+R
|
||||
lm 1 + sm # m+=1
|
||||
lr 2 ^ sa # a:=r*r
|
||||
li 2 ^ sb # b:=i*i
|
||||
|
||||
l0 x # loop
|
||||
] s0
|
||||
l0 x
|
||||
|
||||
lm 32 + P # print "pixel"
|
||||
|
||||
lw 1 + sw # w+=1
|
||||
l1 x # loop
|
||||
] s1
|
||||
l1 x
|
||||
|
||||
A P # linefeed
|
||||
|
||||
lh 1 + sh # h+=1
|
||||
l2 x # loop
|
||||
] s2
|
||||
l2 x
|
||||
37
Task/Mandelbrot-set/Dc/mandelbrot-set-2.dc
Normal file
37
Task/Mandelbrot-set/Dc/mandelbrot-set-2.dc
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
_2.1 sx 0.7 sX _1.2 sy 1.2 sY
|
||||
32 sM
|
||||
640 sW 480 sH
|
||||
8 k
|
||||
[P5] P A P
|
||||
lW n 32 P lH n A P
|
||||
lM 1 - n A P
|
||||
[ q ] sq
|
||||
0 sh
|
||||
[
|
||||
lh lH =q
|
||||
0 sw
|
||||
[
|
||||
lw lW =q
|
||||
lX lx - lW 1 - / lw * lx + sR
|
||||
lY ly - lH 1 - / lh * ly + sI
|
||||
0 sr 0 si 0 sa 0 sb 0 sm
|
||||
[
|
||||
lm lM =q
|
||||
la lb + 4<q
|
||||
2 lr * li * lI + si
|
||||
la lb - lR + sr
|
||||
lm 1 + sm
|
||||
lr 2 ^ sa
|
||||
li 2 ^ sb
|
||||
l0 x
|
||||
] s0
|
||||
l0 x
|
||||
lm 1 - P
|
||||
lw 1 + sw
|
||||
l1 x
|
||||
] s1
|
||||
l1 x
|
||||
lh 1 + sh
|
||||
l2 x
|
||||
] s2
|
||||
l2 x
|
||||
Loading…
Add table
Add a link
Reference in a new issue