HiLogo Source Code

^DEMO5
CS  SAY [Little boxes]
LOCAL side  LOCAL turtles  LOCAL t
MAKE side 80
MAKE turtles [1 2 3 4]
TELL [1 2 3 4 5 6 7 8] HIDE
TELL turtles  CT  LIFT
MAKE t turtles
REPEAT 4 [TELL FIRST t BK side LT 90 FD side MK t BUTFIRST t TELL t RT 90]
TELL turtles  DROP
BOXES side 9  CT
TELL [1 2 3 4 5 6 7] SHOW
TELL 1
.
^BOX SIDE
REPEAT 4 [FORWARD SIDE RIGHT 90]
.
^BOXC side
LIFT BK side/2 LT 90 FD side/2 RT 90 DROP
box side
LIFT LT 90 BK side/2 RT 90 FD side/2 DROP
.
^BOXES side col
SETPC col
BOXC SIDE
IF SIDE>10 [LIFT BK SIDE/2 LT 90 FD SIDE/2 RT 90 REPEAT 4[DROP BOXES SIDE/2 col+1 LIFT FD SIDE RT 90] SETPC col FD SIDE/2 RT 90 FD SIDE/2 LT 90 DROP]
.

Go To: HiLogo