Barnsley fern: Difference between revisions

Content deleted Content added
Chkas (talk | contribs)
1-based index
Added Quackery.
Line 2,482: Line 2,482:
System</syntaxhighlight>
System</syntaxhighlight>


=={{header|Quackery}}==

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

[ ' [ 79 121 66 ] fill
[ 3 2 circle ] ] is dot ( --> )

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

[ 100 1 v* /
dip [ 100 1 v* / ]
2dup toxy
dot
1 2 turn
toxy
1 2 turn ] is plot ( n n --> )


[ 2swap 2drop 0 1
2swap 16 100 v* ] is f1 ( n/d n/d --> n/d n/d )

[ 2over -4 100 v*
2over 85 100 v*
16 10 v+ v+
join dip
[ 4 100 v*
2swap 85 100 v*
v+ ]
do ] is f2 ( n/d n/d --> n/d n/d )

[ 2over 23 100 v*
2over 22 100 v*
16 10 v+ v+
join dip
[ -26 100 v*
2swap 20 100 v*
v+ ]
do ] is f3 ( n/d n/d --> n/d n/d )

[ 2over 26 100 v*
2over 24 100 v*
44 100 v+ v+
join dip
[ 28 100 v*
2swap -15 100 v*
v+ ]
do ] is f4 ( n/d n/d --> n/d n/d )

[ 100 random
[ dup 0 = iff
[ drop f1 ] done
dup 86 < iff
[ drop f2 ] done
93 < iff f3 done
f4 ]
2swap 1000000000 round
2swap 1000000000 round
2over 2over plot ] is nextpoint ( n/d n/d --> n/d n/d )

turtle
' [ 79 121 66 ] colour
-500 1 fly
0 1 0 1
0 frames
20000 times nextpoint
1 frames
4 times drop
</syntaxhighlight>

{{out}}

[[File:Quackery Barnsley fern.png|thumb|center]]


=={{header|R}}==
=={{header|R}}==