HiLogo Source Code

^DEMO2
CS  SAY [Triangulations]
compass
HIDE
SETPC  1  triangles 120 10
SETPC  2  triangles 120 -10
SETPC  5  triangles 120 15
SETPC  9  triangles 120 -15
SETPC 12  triangles 120 25
SETPC 14  triangles 120 -25
SHOW
.
^TRIANGLE side
RIGHT 150 FORWARD side
REPEAT 2 [RIGHT 120 FORWARD side]
LEFT 30
.
^TRIANGLES side angle
triangle side
if side>20 [fd side/3 rt angle triangles side-10 angle lt angle bk side/3]
.
^COMPASS
TELL [1 2 3 4 5 6 7 8]
CT
LOCAL n
MAKE n 1
REPEAT 7 [tell n+1 rt 45*n make n n+1]
TELL [1 2 3 4 5 6 7 8]
SHOW DROP
.

Go To: HiLogo