
Everything so far has been white on black, which is what you get if you never say otherwise. The Einstein draws in sixteen colours, and changing them costs one short instruction.
setpc - set pen colour - takes a number from 0 to 15:
setpc 9
Everything drawn after that is in colour 9 until you say otherwise. It does not change what is already on screen, only what comes next.
| 1 black | 5 light blue | 9 light red | 13 magenta |
| 2 medium green | 6 dark red | 10 dark yellow | 14 grey |
| 3 light green | 7 cyan | 11 light yellow | 15 white |
| 4 dark blue | 8 medium red | 12 dark green |
White is 15, which is why your drawings have been white without your asking.
There is no limit on how many you use at once - all sixteen can be on the screen together.
Give it a number outside the range and it says so rather than guessing:
?setpc 20
setpc doesn't like 20 as input
That form of complaint - this primitive doesn't like that as input - is one you will meet again whenever you hand something the wrong sort of value.
setbg takes the same numbers and fills the whole drawing screen:
setbg 4
Dark blue, in that case. Worth knowing that a colour drawn on top of the same background colour is invisible, which is occasionally useful and more often the explanation for a drawing that has gone missing.
ss
cs
ht
setpc 2
repeat 4 [fd 40 rt 90]
setpc 9
repeat 4 [fd 60 rt 90]
setpc 11
repeat 4 [fd 80 rt 90]
Starting from
A fresh boot, at the ? prompt.
What you should see
Three squares sharing their bottom left corner - a green one forty steps on a side, a light red one sixty, and a light yellow one eighty. Where a bigger square runs along the same edge as a smaller one, the colour you see is the one drawn last.

ht is there to keep the turtle out of the picture; without it, it sits on the
corner where all three squares meet.
setpc 2 to setpc 1. The green square goes. Where has it
gone, and what would you have to change to see it again?setbg 4 on a line of its own after cs, and run the whole thing again.
Which of the three squares is hardest to see now, and why that one?setpc 11 to setpc 16. What does Dr Logo say, and at what
point does it say it - before or after drawing the first two squares?| Symptom | Cause |
|---|---|
setpc doesn't like 20 as input |
The colour numbers stop at 15. |
| A shape you know you drew is not there | It is probably the same colour as the background. Black is 1 and the background starts black. |
| Part of one shape changed colour | Two shapes are sharing an edge. Whichever was drawn last is the one you can see. |
| The colour changes but nothing already drawn does | That is how it works - setpc affects what comes next, not what is there. |
setpc sets the drawing colour and setbg the background, both taking a number
from 0 to 15. A colour applies to everything drawn after it. Out-of-range
numbers are refused rather than guessed at.
S8, running off the edge - what happens when the turtle walks out of the screen, and the three different things you can ask it to do about that.