Jump to content

Chaos game: Difference between revisions

(Added X86 Assembly example using 60 bytes.)
Line 559:
=={{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[]set_color = [ 0 100 50 ]900
cx[] = [ 9000 090100 00950 ]
y[] = [ 93 93 7 ]
x = randomf * 100
c[] = [ 900 090 009 ]
y = randomf * 100
for i range 100000
move_pen x y
h = random 3
rect draw_rect 0.3 0.3
x = (x + x[h]) / 2
h = random 3
y = (y + y[h]) / 2
x = color(x c+ x[h]) / 2
y = move(y x+ y[h]) / 2
rect 0.3 0.3
.</lang>
 
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.