A course for the Dragon 32 · Chapters 0 to 15
In Chapter 1 you saw that 191 is a red block. But every colour square is really four small blocks, two on top and two below. Each small block is a lamp: on, in colour, or off (black).
Each lamp has a fixed value: top left 8, top right 4, bottom left 2, bottom right 1. Add up the values of the lamps that are on, and you get a number from 0 to 15. That is, one digit of the computer: 0 to F.
The number of a colour square has two digits. The right one, as we saw, says which lamps are on. The left one says which colour: 8 green, 9 yellow, A blue, B red, C white, D cyan, E magenta, F orange.
$BF: red, with all the lamps on (8+4+2+1 = 15 = F). Now it is also clear why 143 ($8F) can’t be seen: full green on a green background.Press the lamps to turn them on and off, and choose a colour. Next to it you can see how the number is built.
In Chapter 0 we promised to find out why a house only holds up to 255. Here is the answer: every house is really eight lamps. Four for the left digit and four more for the right one.
Here too each lamp has a value: from the right 1, 2, 4, 8, and we keep doubling: 16, 32, 64, 128. When all eight are on: 128+64+32+16+8+4+2+1 = 255. There is no ninth lamp, so there is no room for 256.
Every house in memory is eight lamps like these, even when it isn’t a colour square. The letter A (65) is lamp 64 and lamp 1. The computer doesn’t know it’s a letter; only the screen draws it that way.
We wanted a square with only its left half blue. Which number goes in the empty space?
Your screen has to match the picture. Squares that are different will be marked in red. Hover over the picture (or tap it) to see the house number and the number in each square.
0000 ERRS) and run. We checked number by number: what was written in each square of the screen matches what the windows here show, and the colours match the Dragon machine’s colours too.A hobbyist tribute project, not affiliated with or endorsed by Dragon Data. The course, drawings and text are our own. Every program in the course was checked on the site's Dragon machine (XRoar running the BASIC we wrote).