EasyManuals Logo

Sinclair QL Beginner's Guide

Sinclair QL
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #18 background imageLoading...
Page #18 background image
Colours have codes as described below.
Code
Effect
8 colour
4 colour
0
black
black
1
blue
black
2
red
red
3
magenta
red
4
green
green
5
cyan
green
6
yellow
white
7
white
white
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

Other manuals for Sinclair QL

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair QL and is the answer not in the manual?

Sinclair QL Specifications

General IconGeneral
ProcessorMotorola 68008
Clock Speed7.5 MHz
RAM128 KB (expandable to 640 KB)
ROM48 KB
Operating SystemSinclair QDOS
Release Year1984
StorageMicrodrive tape loop
Graphics256x256 pixels, 8 colors
PortsRS-232, ROM cartridge
SoundBeeper (internal speaker)

Related product manuals