COVINSTCOVERUPCOVINST!BOOT 3 #v
#0*BASIC
PAGE=&1900
*FX21
CLOSE#0:CHAIN "COVINST"
COVER UP
WRITTEN BY ROSS HUNTER
$ PERSONAL COMPUTER WORLD MAY 87
( Instructions from mag.
2*FX200,3
<7:23;8202;0;0;0;
F13,1)"COVER UP "
P12"By Ross Hunter"
Z'" This game is based on an old pub game played with two dice and a card marked with numbers from 1 to 9. The first player throws the dice and covers any numbers that total the same as the dice"
dr"throw. This process is continued until the number thrown cannot be totalled from the numbers remaining."
nq"If at any time before a throw the total of the numbers remaining is less than 6, only one die is thrown."
x"When a player can no longer go, the score is read from left to right (the numbers are placed in descending order).So, if 6, 3 and 2 were left, the score would be 632. The same procedure is"
J"followed by all players, and the one with the lowest score wins."
7'"PRESS A KEY TO SEE THE NEXT PAGE. ":*FX15,0
A$=:
13,1)"COVER UP "
'" The program gives a choice of two versions of the game and can be played by two players or against the computer."
8"The two versions are Low Line and Knockout."
" In Low Line, the first player is given a row of black numbers and a random number. The player must change the blacknumbers to red by totalling them up to the random number."
Ƞ"When player one can no longer go, it's player two's turn to try to turn a line of red numbers to black. The winner is the player with the lowest score."
k" Knockout is similar except that the game continues until all the numbers' colours are changed."
K" You can press 'ESCAPE' during the game to return to the title page."
7'"NOW PRESS A KEY TO LOAD THE GAME. ":*FX15,0
A$=::=&1900:"COVERUP"
Cover Up.
(C) Ross Hunter 1986.
% For the BBC model B / B+ micro.
(:
2>&E00P@}
<*FX200,3
F N%(9)
PG1%=0:G2%=0:P%=1
Zcomputer%=:P2$="Player 2 "
d:
n 1
x& *FX 4,1 Disables cursor editing.
*FX 4,1
.23,1,0;0;0;0;: Turn flashing cursor off.
" 19,3,4;0; : White = Blue.
131: : Blue background.
DbL
graphics
:
9 Choose whether or not to have computer as player 2.
129:2
3,3)" COVER UP "
130:3
+23,18)"Against Computer" 29,22)"Y/N"
*FX 21,0
:K%= 32
K%="y" K%="n"
) K%="y" computer%=:P2$="Computer "
"*FX200,2
,7 Main loop. Repeats until ESCAPE or BREAK pressed.
6
@
Jlowline%=:knockout%=
TP1%=987654321:P2%=P1%
^
h7 Clear game title and print games played and wins.
r129:2
21,3)(17)
%1,16)"Games played ";G1%+G2%
:1,19)"Wins player 1 ";G1% 1,22)"Wins "P2$" ";G2%
1,25)(19) 1,28)(19)
' Choose Low Line or Knockout game.
cleartext
130:7
23,18)"Choose Your Game"
823,21)"L.......LOW LINE" 23,23)"K.......KNOCKOUT"
*FX 21,0
:K%= 32
K%="k" K%="l"
& K%="l" lowline%= knockout%=
) Print text relevant to game chosen.
129:2
&26,3);
0( lowline% "LOW LINE" "KNOCKOUT"
:1,25);
D9 lowline% "Player 1 ";P1% "Player 1 make Red"
N1,28);
X/ lowline% P2$" ";P2% P2$"make black"
b
lF Print numbers 9 to 1 in colour P%1 ready for player P% to play.
v count%=1 9
N%(count%)=P%1
printnums
cleartext
*FX 21,0
25,18)"PRESS RETURN"
=13
+ Play chosen game until a player wins.
cleartext
random
win%=
$ knockout% knockout lowline
win%
Player P% wins.
* P%=1 G1%=G1%+1 G2%=G2%+1
4cleartext
>
23,18);
H. computer% P%=1 "Player ";P%;" wins"
R' computer% P%=2 "computer wins"
\23,22)"PRESS RETURN KEY"
f*FX21,0
p =13
z
Back to choose next game.
1 P%=winner the winner plays next game first.
:
Knockout game.
knockout
check(num%)
P%=1 col%=1 col%=0
play% noplay
play% move
K if all displayed numbers have been made red for player 1 or black for
% player 2 then that player wins.
win%=
$ pos%=1 9
. N%(pos%)=P%1 win%=
8
B7 win% P%=P%+1: P%=3 P%=1: Next player to play.
L
V:
` lowline game.
j lowline
tcheck(num%)
~ play% noplay
P%=1 col%=1 col%=0
play% move
L Set P1% or P2% to total of numbers changed reading from left to right.
P$=""
pos%=9 1 1
! N%(pos%)=P%1 P$=P$+(pos%)
P%=1 P1%=(P$) P2%=(P$)
129:2
11,25)(9((P1%)));P1%
11,28)(9((P2%)));P2%
+ play% : Until player can not play.
1 Print numbers 9 to 1 ready for next player.
( C%=1 9
2 P%=1 N%(C%)=1 N%(C%)=0
<
Fprintnums
P
Z< if both players played set P% to winner and win%=TRUE.
d
win%=
n* P1%<987654321 P2%<987654321 win%=
x0 win% P%=P%+1: P%=3 P%=1: Swap players.
6 win% P%=1 P1%>P2% P%=2 : P%=Winning player.
:
D move cursor to choose numbers until numbers chosen total num%.
move
cleartext
723,18);: P%=2 P2$"to play" "Player 1 to play"
3 computer% P%=1 23,21)"< > TO MOVE"
3 computer% P%=1 23,23)"RETURN TO PICK"
+ computer% P%=2 delay%=1 10000:
5 Cursor EORed with background and drawn under 9.
Y%=595:X%=64:pos%=9
3,1: X%,Y%: X%+96,Y%
& Until numbers chosen total num%.
"
,
6E Until chosen number(pos%) is colour P%1 AND pos% is not > num%
@
J
T5 Until a number chosen by player P% or computer.
^
h# computer% P%=2 K%=13 K%=
r K%=136 K%=137 K%=13

computer% P%=2 computer
X%,Y%: X%+96,Y%
8 K%=137 pos%=pos%1:X%=X%+128: pos%=0 pos%=9:X%=64
; K%=136 pos%=pos%+1:X%=X%128: pos%=10 pos%=1:X%=1088
X%,Y%: X%+96,Y%
* K%=13 N%(pos%)=P%1 num%pos%>=0
N%(pos%)=col%
check(num%pos%)
play% N%(pos%)=P%1
) computer% P%=2 delay=1 5000:
play% num%=num%pos%
printnums
3:30,28);
( num%>9 ;num% num%>0 "O";num%
num%=0
&
0 X%,Y%: X%+96,Y%
:
D:
N* Computer sets pos% and moves cursor.
X computer
bpos%=10
l
vpos%=pos%1
) N%(pos%)=P%1 num%=pos% pos%<=6
pos%<=6 pos%=(9)
X%,Y%: X%+96,Y%
X%=64+(pos%9)*128
X%,Y%: X%+96,Y%
K%=13
:
' Get and print random number num%.
random
rnd%=0
count%=1 9
& N%(count%)=P%1 rnd%=rnd%+count%
7 rnd%=total value of numbers player P% can change.
130:3
* rnd%>6 rnd%=12 rnd%=6
4 count%=0 10
>num%=(rnd%)
H 1,5,150,1
R)30,28);: num%>9 ;num% "O";num%
\ delay%=0 500:
f
p
z:
5 Print the numbers 9 to 1 in colours N%(count%).
printnums
130
count%=9
tab%=3 35 4
N%(count%)
tab%,11);count%
count%=count%1
:
Print the no play text.
noplay
cleartext
 computer% P%=1 27,18)"Player ";P%
(computer% P%=2 27,18)"COMPUTER"
$425,21)"CAN NOT PLAY" 23,23)"PRESS RETURN KEY"
.*FX21,0
8 =13
Bcleartext
L
V:
`( Draw screen graphics. See PROCbox.
j graphics
t4box(131,129,4,863,634,100,20): Tital box left.
~7box(131,129,640,863,635,100,20): Tital box right.
>box(131,130,703,224,572,160,20): Instruction box bottom.
:box(131,130,703,384,572,96,20): Instruction box top.
7box(131,130,927,64,128,96,20): Random number box.
Boxes for numbers 9 to 1.
8 X%=64 1120 128:box(131,130,X%,611,96,96,20):
Bottom information boxes.
5 Y%=64 160 96:box(131,129,4,Y%,672,96,20):
Top information boxes.
6 Y%=256 448 96:box(131,129,4,Y%,640,96,20):
:
Draw a box with a border.
( O%=Border colour. I%=Inner colour.
 X%=Coordinate across. Y%=Coordinate up.
) W%=Width. H%=Hight. B%=Border size.
box(O%,I%,X%,Y%,W%,H%,B%)
(% 24,X%;Y%;X%+W%;Y%+H%;18,0,O%,16
21 24,X%+B%;Y%+B%;X%+W%B%;Y%+H%B%;18,0,I%,16
< 26,18,0,0
F X%,Y%: X%+B%,Y%+B%
P X%,Y%+H%: X%+B%,Y%+H%B%
Z% X%+W%,Y%+H%: X%+W%B%,Y%+H%B%
d X%+W%,Y%: X%+W%B%,Y%+B%
n$ X%,Y%: X%,Y%+H%: X%+W%,Y%+H%
x X%+W%,Y%: X%,Y%
6 X%+B%,Y%+B%: X%+B%,Y%+H%B%: X%+W%B%,Y%+H%B%
" X%+W%B%,Y%+B%: X%+B%,Y%+B%
:
 Clear all text in the insruction boxes.
cleartext
130:3
23,18)(16)
tab%=21 23
23,tab%)(16)
:
, Check that (for%) can be used to play.
check(for%)
for%=0 play%=:
"play%=
,
dtK
6
@H Locate start of data giving all posable combinations of the digits
J# 1 to 9 that can total (for%).
T
^ E%
h E%100=for%
r
9 P%1=numbers being the colour player P% may change.
; If one combination in the colour is found play%=TRUE.
N%(0)=P%1
I%=P%1
E%,F%,G%,H%
. E%>100 dLK : IF END OF DATA FOR for%
; N%(E%)=I% N%(F%)=I% N%(G%)=I% N%(H%)=I% play%=
E%>100
:
Data for PROCcheck
H 101,1,0,0,0 ,102,2,0,0,0 ,103,3,0,0,0,2,1,0,0 ,104,4,0,0,0,3,1,0,0
F 105,5,0,0,0,4,1,0,0,3,2,0,0 ,106,6,0,0,0,5,1,0,0,4,2,0,0,1,2,3,0
F 107,7,0,0,0,6,1,0,0,5,2,0,0,4,3,0,0,1,2,4,0, 108,8,0,0,0,7,1,0,0
B 6,2,0,0,5,3,0,0,1,2,5,0,1,3,4,0 ,109,9,0,0,0,8,1,0,0,7,2,0,0
B 6,3,0,0,5,4,0,0,1,2,6,0,1,3,5,0 ,110,9,1,0,0,8,2,0,0,7,3,0,0
&B 6,4,0,0,1,2,7,0,1,3,6,0,1,4,5,0,1,2,3,4,2,3,5,0 ,111,9,2,0,0
0E 8,3,0,0,7,4,0,0,6,5,0,0,1,2,8,0,1,3,7,0,1,4,6,0,5,4,2,0,6,3,2,0
:B 1,2,3,5 ,112,9,3,0,0,8,4,0,0,7,5,0,0,1,2,9,0,1,3,8,0,1,4,7,0
D( 1,5,6,0,1,2,3,6,1,2,4,5 ,113,0,0,0
N:
X" Error routine from line 170.
b=17
l0:130
v0,31)
:" at line ";
:
% Relocation routine from line 50
} *TAPE
}
EI%=0P 4:I%!&E00=I%!::?&13=?&13(&E00)256:=&E00:=P: