Sinclair QL Beginner's Manual page 126

Hide thumbs Also See for QL:
Table of Contents

Advertisement

430
REPeat compare
440
450
460
470
END REPeat compare
480
LET sort(dart) = comp
490
END FOR item
500 END DEFine
510 DEFine PROCedure layout
520
PAPER #6,4 : CLS #6
530
BORDER #6,10,0
540
BLOCK #6,100,60,150,60,2,4
550 END DEFine
560 DEFine PROCedure printem
570
LET inc = 12 : INK #6,7
580
LET p = 0
590
FOR seat = 1 TO 4
600
READ ac,dn
610
FOR row = 1 TO 4
620
630
640
650
660
END FOR row
670
END FOR seat
680 END DEFine
690 DEFine PROCedure getline
700
IF row MOD 2 = 0 THEN STRIP #6,0
710
IF row MOD 2 = 1 THEN STRIP #6,2
720
LET lin$ = tok$(row)
730
LET max = row*13
740
REPeat one_suit
750
LET p = p + 1
760
LET n = card(p)
770
IF n >max THEN p = p-1 : EXIT one_suit
780
LET n = n MOD 13
790
IF n = 0 THEN n = 13
800
IF n = 1 : LET ch$ = "A"
810
IF n >= 2 AND n <= 9 : LET ch$ = n
820
IF n = 10 : LET ch$ = "T"
830
IF n = 11 : LET ch$ = "J"
840
IF n = 12 : LET ch$ = "Q"
850
IF n = 13 : LET ch$ = "K"
860
LET lin$ = lin$ & " " & ch$
870
IF p = 52 : EXIT one_suit
880
IF card(p)>card(p+1) : EXIT one_suit
890
END REPeat one_suit
900 END DEFine
910 DATA "H:","C:","D:","S:"
920 DATA 150,10,260,60,150,130,30,60
COMMENT
The program works in the 256 mode. But the various lines of card symbols may overlap the "table" or
overflow at the edge of the window. A simple change in procedure "getline" from:
860 LET lin$ = lin$ & " " & ch$
to
IF comp >= sort(dart-1) : EXIT compare
LET sort(dart) = sort(dart-1)
LET dart = dart - 1
getline
CURSOR #6,ac,dn
PRINT #6,1in$
LET dn = dn + inc

Advertisement

Table of Contents
loading

Table of Contents