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 #62 background imageLoading...
Page #62 background image
Basically numeric expressions in SuperBASIC are the same as those of mathematics but you must
put the whole expression in the form of a sequence.
5+3
6-4
becomes in SuperBASIC (or other BASIC):
(5 + 3)/(6 - 4)
In secondary school algebra there is an expression for one solution of a quadratic equation:
ax
2
+ bx + c = 0
One solution in mathematical notation is:
If we start with the equation:
2x
2
- 3x + 1 = 0
Example 1
The following program will find one solution.
100 READ a,b,c
110 PRINT 'Root is' ! (-b+SQRT(b^2 - 4*a*c))/(2*a)
120 DATA 2,-3,1
Example 2
In problems which need to simulate the dealing of cards you can make cards correspond to the
numbers 1 to 52 as follows:
1 to 13
14 to 26
27 to 39
40 to 52
Ace, two........king of hearts
Ace, two........king of clubs
Ace, two........king of diamonds
Ace, two........king of spades
A particular card can be identified as follows:
100 REM Card identification
110 LET card = 23
120 LET suit = (card-1) DIV 13
130 LET value = card MOD 13
140 IF value = 0 THEN LET value = 13
150 IF value = 1 THEN PRINT "Ace of ";
160 IF value >= 2 AND value <= 10 THEN PRINT value ! "of ";
170 IF value = 11 THEN PRINT "Jack of ";
180 IF value = 12 THEN PRINT "Queen of ";
190 IF value = 13 THEN PRINT "King of ";
200 IF suit = 0 THEN PRINT "hearts"

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