Brownian tree: Difference between revisions

(Added compression when saving.)
Line 921:
[https://easylang.online/apps/_brownian-tree.html Run it]
 
<lang>set_colorset_rgb 0990 1 1
len f[] 200 * 200
move_pen 50 50
Line 928:
n = 9000
while i < n
repeat
x = random 200
y = random 200
while f[y * 200 + x] = 1
x = random 200
y = random 200
while until f[y * 200 + x] =<> 1
.
while x1 <>= -1
xo = x
yo = y
Line 940 ⟶ 939:
y += random 3 - 1
if x < 0 or y < 0 or x >= 200 or y >= 200
xbreak = -1
else.
if f[y * 200 + x] = 1
move_pen xo / 2 yo / 2
draw_rect 0.5 0.5
f[yo * 200 + xo] = 1
i += 1
if i mod 16 = 0
set_redset_rgb 0.2 + i / n 1 1
sleep 0
.
x = -1
.
break .1
.
.
1,983

edits