Chaos game: Difference between revisions

Content added Content deleted
(Added X86 Assembly example using 60 bytes.)
Line 559: Line 559:
=={{header|EasyLang}}==
=={{header|EasyLang}}==


[https://easylang.online/apps/_chaos-game.html Run it]
[https://easylang.online/ide/?run=x%5B%5D%3D%5B%200%20100%2050%20%5D%0Ay%5B%5D%3D%5B%2093%2093%207%20%5D%0Ac%5B%5D%3D%5B%20900%20090%20009%20%5D%0Afor%20i%20range%20100000%0Ah%3Drandom%203%0Ax%3D%28x%2Bx%5Bh%5D%29/2%0Ay%3D%28y%2By%5Bh%5D%29/2%0Acolor%20c%5Bh%5D%0Amove%20x%20y%0Arect%200.3%200.3%0A. Run it]


<lang>x[] = [ 0 100 50 ]
<lang>set_color 900
x[] = [ 0 100 50 ]
y[] = [ 93 93 7 ]
y[] = [ 93 93 7 ]
x = randomf * 100
c[] = [ 900 090 009 ]
y = randomf * 100
for i range 100000
for i range 100000
move_pen x y
h = random 3
draw_rect 0.3 0.3
x = (x + x[h]) / 2
h = random 3
y = (y + y[h]) / 2
color c[h]
x = (x + x[h]) / 2
move x y
y = (y + y[h]) / 2
rect 0.3 0.3
.</lang>
.</lang>