Brownian tree: Difference between revisions

Content added Content deleted
m (→‎{{header|JavaScript}} + <canvas>: Regularize markup, libraries don't go in the language header)
Line 1,016: Line 1,016:
[https://easylang.online/apps/_brownian-tree.html Run it]
[https://easylang.online/apps/_brownian-tree.html Run it]


<lang>set_rgb 0 1 1
<lang>color3 0 1 1
len f[] 200 * 200
len f[] 200 * 200
move_pen 50 50
move 50 50
draw_rect 0.5 0.5
rect 0.5 0.5
f[100 * 200 + 100] = 1
f[100 * 200 + 100] = 1
n = 9000
n = 9000
Line 1,037: Line 1,037:
.
.
if f[y * 200 + x] = 1
if f[y * 200 + x] = 1
move_pen xo / 2 yo / 2
move xo / 2 yo / 2
draw_rect 0.5 0.5
rect 0.5 0.5
f[yo * 200 + xo] = 1
f[yo * 200 + xo] = 1
i += 1
i += 1
if i mod 16 = 0
if i mod 16 = 0
set_rgb 0.2 + i / n 1 1
color3 0.2 + i / n 1 1
sleep 0
sleep 0
.
.