The Procedures used in "house"

to door
pu
home
pd
ht
lt 90
fd 10
rt 90
fd 40
rt 90
fd 20
rt 90
fd40
pu
home
pd
end

;;;;;;;;;;;;;;;

;

;

;

to glass
pu
home
pd
ht
pu
lt 90
fd 40
rt 90
fd 25
pd
fd 20
rt 90
fd 20
rt 90
fd 20
rt 90
fd 20
pu
home
pd
end

;;;;;;;;;;;;;;;

to roof
pu
home
pd
ht
pu
lt 90
fd 50
rt 90
fd 50
pd
lt 90
fd 20
rt 135
fd 100
rt 90
fd 100
rt 135
fd 20
pu
home
pd
end

;;;;;;;;;;;;;;;;

;

;

;

to walls
pu
home
pd
ht
lt 90
fd 50
rt 90
fd 50
rt 90
fd 100
rt 90
fd 50
rt 90
fd 50
pu
home
pd
end

;

;;;;;;;;;;;;;;;;;

;

The complete house is drawn by calling each of the smaller procedures in the procedure called house:

to house
walls
door
roof
glass
end

NOTE: Each of the procedures on the left begins with pu home pd and ht and ends with pu home and pd. This ensures that the turtle always starts at the home position at the start of a procedure and ends at the home position at the end of the procedure. It is a good idea to follow this practice when designing your own procedures.

;

;

;

;

;

(Ignore the extra semi-colons. They are needed to format the table width in some browsers)

<-Back