Chaos game: Difference between revisions

Content added Content deleted
Line 771: Line 771:
[https://easylang.online/apps/_chaos-game.html Run it]
[https://easylang.online/apps/_chaos-game.html Run it]


<syntaxhighlight lang="text">color 900
<syntaxhighlight lang="text">
color 900
x[] = [ 0 100 50 ]
x[] = [ 0 100 50 ]
y[] = [ 93 93 7 ]
y[] = [ 93 93 7 ]
x = randomf * 100
x = randomf * 100
y = randomf * 100
y = randomf * 100
for i range 100000
for i = 1 to 100000
move x y
move x y
rect 0.3 0.3
rect 0.3 0.3
Line 782: Line 783:
x = (x + x[h]) / 2
x = (x + x[h]) / 2
y = (y + y[h]) / 2
y = (y + y[h]) / 2
.
.</syntaxhighlight>
</syntaxhighlight>

=={{header|Emacs Lisp}}==
=={{header|Emacs Lisp}}==
<syntaxhighlight lang="lisp">; Chaos game
<syntaxhighlight lang="lisp">; Chaos game