home
clearscreen
cleartextmake “cnt 0
make “size 10
make “wafer 200
make “whalf :wafer/2
; ——————-
TO SQUARE :length
REPEAT 4 [FW :length RT 90]
FW :length
END
; ——————–; draw the origin and wafer
home
circle 5
circle :whalf; move turtle to top left to start drawing grid
pu
fw :whalf
lt 90
fw :whalf
rt 90
pd;orient turtle looking EAST
RT 90; draw the grid
; two rows of squares at a time
; go out to the EAST, down back to the west
; drop down two rows and reorient the turtle to the EAST
;; do it again.. (outer loop)
REPEAT 10 [REPEAT 2 [ REPEAT 20 [ SQUARE :size make “cnt :cnt+1 ] RT 90 FW :size2 RT 90 ] RT 90 FW :size2 LT 90 ];REPEAT 4 [REPEAT 2 [REPEAT 20 [SQUARE :size make “cnt :cnt+1] RT 90 FW :size*4 RT 90]RT 90 FW :size LT 90]
; SQRT exists as undoc fct…
make “y SQRT :cnt
print [“number “of “squares ]
print :cnt


































