For example, INK 3 would give magenta in MODE 8 and red in MODE 4.
We will explain in a later chapter how the basic colours can be 'mixed' in various ways to produce a
startling range of colours, shades and textures.
RANDOM EFFECTS
You can get some interesting effects with random numbers which can be generated with the RND
function. For example:
PRINT RND (1 TO 6)
will print a whole number in the range 1 to 6, like throwing an ordinary six-sided dice. The following
program will illustrate this:
NEW
10 LET die = RND(1 TO 6)
20 PRINT die
RUN
If you run the program several times you will get different numbers.
You can get random whole numbers in any range you like. For example:
RND(0 TO 100)
will produce a number which can be used in scale graphics. You can re-write the line program so that
it produces a random colour. Where the range of random numbers starts from zero you can omit the
first number and write:
RND(100)
NEW
10 PAPER 7 : CLS
20 INK RND(5)
30 LINE 50,60 TO RND(100),RND(100)
RUN
This produces a line starting somewhere near the centre of the screen and finishing at some random
point. The range of possible colours depends on which mode is selected. You will find that a range of
numbers ‘something TO something’ occurs often in SuperBASIC.
BORDERS