EasyManuals Logo

Sinclair QL User Manual

Sinclair QL
422 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 #94 background imageLoading...
Page #94 background image
1.
PROBLEMS
ON
CHAPTER
13
SORTING
Place
ten
numbers
in
an
array
by
reading
from
a
DATA
statement Search the array
to
find the lowest number. Make this lowest number the
value
of
the
first
elemenf
of
a new
array.
Replace
it
in
fhe
first
array with a
very
large number. Repeat this
process making the second lowest number the second value
In
the new array
and
so
on
until you
have
a sorted array
of
numbers which should then be printed.
2.
SNAKES AND LADDERS
Represent a snakes and ladders game
with
a
100
element numeric
array.
Each
element should contain either:
3.
zero
or a number
in
the range
10
to
90 meaning
that
a player should transter
to
that
number by going 'up a ladder' or down a
snake:
or the digits
1,
2,
3,
etc.
to
denote a particular player's position.
Set
up
SIX
snakes and
six
ladders
by
placing numbers
In
the array and simulate
one
'solo'
run
by
a single player
to
test
the game.
CROSSWORD BLANKS
columns
2
row
3
4
5
4.
Crosswords usually have
an
odd number
ot
rows
or
columns
in
which the black
squares
have
a symmetrical pattern.
The
pattern
IS
said
to
have
rotational
symmetry
because rotation through
180
degrees would not change
it
Note that after rotation through
180
degrees the square
In
row
4,
column 1 could
become the square
in
row
2,
column
5.
That
IS
row
4,
column 1 becomes row
2,
column 5
in
a 5 X 5 grid.
Write
a program
to
generate and display a symmetrical pattern
of
this kind.
Modify the crossword pattern
so
that there
are
no sequences, across or down,
of
less
than four white squares.
5.
CARD SHUFFLE
78
6.
Cards
are
denoted by the numbers
1-52
stored
in
an
array.
They
can
be
converted
easily
to
actual card values when necessary.
The
cards should be 'shuffled'
as
follows.
Choose any position
in
range 1-51
e.g.
17.
Place the card
in
this position
In
a temporary
store.
Shunt
all
the cards
in
positions 52
to
18
down
to
positions
51
to
17.
Place the chosen card from the temporary store
to
position 52.
Deal
similarly
With
the ranges
1-50,
1-49
..
down
to
1-2
so that the pack
is
well
shuffled.
Output the result
of
the
shuffle.
Set
up
six
DATA
statements each containing a surname, initials and a telephone
number (dialling code and local number). Decide
on
a suitable structure
of
arrays
to
store this information and READ
It
into the
arrays.
PRINT the data using a separate FOR loop and explain how the input format
(DATA),
the
Internal
format
(arrays)
and output
format
are
not
necessarily
all
the
same.

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