You will need to start off printing " ", & change to either " " or " ", according as A is more or less than
B.
What does your program do if A & B are not whole numbers? Or if thet are not in the range 0 to 32? a
good - 'user friendly' is the fashionable term - program will do something sensible & useful.
4. There are two different all grey characters on the keyboard, on A & H. If you look at them very close up,
you will see that the one on H is like a miniature chessboard, while the one on A is like a sideways
chessboard. Print them next to each other, & you will see that they don't join up properly. The one on A is
used to join up neatly with & (on S & D), while the one on H joins up neatly with & (on F & G).
5. Run this program:
10
INPUT
A
20
PRINT CHR$
A;
30
GOTO
10
If you experiment with it, you will find that for CHR$, A is rounded to the nearest whole number; & if A is
not in the range 0 to 255 then the program stops with report B.
6. Using the codes for the characters, we can extend the concept of 'alphabetical ordering' to cover strings
containing any characters, not just letters. If instead of thinking in terms of the usual alphabet of 26 letters
we use the extended aphabet of 256 characters, in the same order as their codes, then the principle is
exactly the same. For instance, these strings are in ZX81 alphabetical order.
" ZACHARY"
" "
"(ASIDE)"
"123 TAXI SERVICE"
"AASVOGEL"
"AA "
"ZACHARY"
" RDVARK"
Here is the rule. First, compare the first characters in the two strings. If these are different, then one of
them has its code less than the other, & the string of which it is the first character is the earlier (lesser) of
the two strings. If they are the same, then go on to compare the next characters. If in this process one of
the strings runs out before the other, then that string is the earlier; otherwise they must be equal.
Type in again the program in exercise 4 of chapter 10 (the one that inputs two strings & prints them in
order), & use it to experiment.
7. This program prints a screenful of random black & white graphics characters:
10
LET
A=
INT
(16*
RND
)
20
IF
A>=8
THEN
LET
A=A+120
30
PRINT
CHR$
A;
40
GOTO
10
(How does it work?)