Permalink

Demos

Test Square (redundant) Square (refactored) Square (Animated!) Squares (decreasing size) Squares (rainbow) Triangle Circle Dotted Circle Spirograph 1 Spirograph 2 6-Pointed Flower 12-Pointed Flower Sun Flower Galaxy Galaxy (Animated!) Spiral Flower Clock

Usage

h Home Reset x,y to 160,160 [h]
n North Reset bearing [n]
g Go Sets x,y from stack [10,20g]
c Clear Clears canvas [c] (useful for animation)
f Forward Draws forward n pixels [10f]
m Move Moves forward n pixels [10m]
l Left Turn bearing left n degrees [90l]
r Right Turn bearing right n degrees [90r]
x Repeat Repeats quotation n times [(100f90r)4x]
a Add Adds two numbers [4,2a]
- Subtract Subtracts two numbers [4,2-]
* Multiply Multiplies two numbers [4,2*]
v Divide Divides two numbers [4,2v]
j Join Prepends head onto quotation [10(f90r)c]
u Unjoin Separates head from tail [(10f90r)u]
d Dup Duplicates top stack value [u]
w Swap Swaps top two stack values [w]
o Drop Discards top stack value [o]
i Dip Applies quote below next value [10,20(f)i]
Parenthesis surround quotations [(100f90r)].
Digits [0123456789] build decimal numbers. Commas separate adjacent numbers.
Define unused characters by following quotation. [(90r)R] defines 'R' as substitution for '90r'.
Canvas is 320x320. Turtle begins at 160,160 bearing North.