Brownian tree: Difference between revisions

Content added Content deleted
(→‎{{header|Liberty BASIC}}: add Locomotive Basic version)
Line 919:
=={{header|EasyLang}}==
 
[https://easylang.online/apps/_brownian-tree.html Run it]
[https://easylang.online/ide/?run=rect%20100%20100%0Acolor%20099%0Alen%20f%5B%5D%20200%2A200%0Amove%2050%2050%0Arect%200.5%200.5%0Af%5B100%2A200%2B100%5D%3D1%0An%3D9000%0Awhile%20i%20%3C%20n%0Ax%3Drandom%20200%0Ay%3Drandom%20200%0Awhile%20f%5By%2A200%2Bx%5D%3D1%0Ax%3Drandom%20200%0Ay%3Drandom%20200%0A.%0Awhile%20x%20%3C%3E%20-1%0Axo%3Dx%0Ayo%3Dy%0Ax%2B%3Drandom%203-1%0Ay%2B%3Drandom%203-1%0Aif%20x%20%3C%200%20or%20y%20%3C%200%20or%20x%20%3E%3D%20200%20or%20y%20%3E%3D%20200%0Ax%3D-1%0Aelse%0Aif%20f%5By%2A200%2Bx%5D%3D1%0Amove%20xo/2%20yo/2%0Arect%200.5%200.5%0Af%5Byo%2A200%2Bxo%5D%3D1%0Ai%2B%3D1%0Aif%20i%20mod%2016%3D0%0Acolor_red%200.2%2Bi/n%0Asleep%200%0A.%0Ax%3D-1%0A.%0A.%0A.%0A. Run it]
 
<lang>rectset_color 100 100099
color 099
len f[] 200 * 200
movemove_pen 50 50
rectdraw_rect 0.5 0.5
f[100 * 200 + 100] = 1
n = 9000
Line 944 ⟶ 943:
else
if f[y * 200 + x] = 1
movemove_pen xo / 2 yo / 2
rectdraw_rect 0.5 0.5
f[yo * 200 + xo] = 1
i += 1
if i mod 16 = 0
color_redset_red 0.2 + i / n
sleep 0
.