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 #125 background imageLoading...
Page #125 background image
ac,dn
cursor position for characters
row
current row for characters
lin$
builds up row of characters
max
highest card number
p
points to card position
n
current number of card
PROCEDURES
Shuffle
shuffles 52 cards
Split
splits cards into four hands and calls sortem to sort each hand
Sortem
sorts 13 cards in ascending order
Layout
provides background colour border and table
Printem
prints each line of card symbols
Getline
gets one row of cards and converts numbers into the symbols
A,2,3,4,5,6,7,8,9,T,J,Q,K
PROGRAM DESIGN OUTLINE
1. Declare arrays, pick up 'tokens' and place 52 numbers in array card.
2. Shuffle cards.
3. Split into 4 hands and sort each.
4. OPEN screen window.
5. Fix the screen layout.
6. Print the four hands.
7. CLOSE the screen window.
100 DIM card(52),sort(13),tok$(4,2)
110 FOR k = 1 TO 4 : READ tok$(k)
120 FOR k = 1 TO 52 : LET card(k) = k
130 shuffle
140 split
150 OPEN #6,scr_440x220a35x15
160 layout
170 printem
180 CLOSE #6
190 DEFine PROCedure shuffle
200 FOR c = 52 TO 3 STEP -1
210 LET ran = RND(1 to c-1)
220 LET temp = card(c)
230 LET card(c) = card(ran)
240 LET card(ran) = temp
250 END FOR c
260 END DEFine
270 DEFine PROCedure split
280 FOR h = 1 TO 4
290 FOR c = 1 TO 13
300 LET sort(c) = card((h-1)*13+c)
310 END FOR c
320 sortem
330 FOR c = 1 TO 13
340 LET card((h-1)*13+c) = sort(c)
350 END FOR c
360 END FOR h
370 END DEFine
380 DEFine PROCedure sortem
390 FOR item = 2 TO 13
400 LET dart = item
410 LET comp = sort(dart)
420 LET sort(0) = comp

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