Chaos game: Difference between revisions

Content added Content deleted
(Added Quackery.)
Line 2,523: Line 2,523:


</syntaxhighlight>
</syntaxhighlight>

=={{header|Quackery}}==

<syntaxhighlight lang="Quackery"> [ $ "turtleduck.qky" loadfile ] now!

[ 2 3 circle ] is dot ( --> )

[ 1 fly
-1 4 turn
1 fly
1 4 turn ] is toxy ( n n --> )

[ swap 2dup toxy
dot
1 2 turn
toxy
1 2 turn ] is plot ( n n --> )

[ 200 random
346 random
over 346 *
over 200 * < if
[ dip [ 400 + ]
692 swap - ] ] is intriangle ( --> n n )

[ 3 random
[ table
[ 2 /
dip [ 2 / ] ]
[ 2 /
dip [ 800 + 2 / ] ]
[ 692 + 2 /
dip [ 400 + 2 / ] ] ]
do ] is tovertex ( n n --> )

turtle
-400 1 fly
1 4 turn
340 1 fly
-1 4 turn
intriangle
10000 times
[ 2dup plot
tovertex ]
2drop</syntaxhighlight>

{{out}}

[[File:Quackery chaos game.png|thumb|center]]

=={{header|R}}==
=={{header|R}}==
Note: Find plotmat() here on RosettaCode Wiki.
Note: Find plotmat() here on RosettaCode Wiki.