d4H !>F >~
>sd= a program for the S.M.U.G. competition by Colin Tringham
n :
x 220,16: zot cursor
0 10,1: " NUMBER - PICK - a game for two "
:
100
: "You pick a spot on the square grid and try to match"
5 "the number there (1-9) with your second choice"
"First with 5 pairs wins"
2 :"Do not select a blank position as this has"
5 "been selected already and will waste your turn."
0,16: 0
" : A(9,9),B(2),C(2),D0(2),E(4)
790: intialise grid
' D0$(1) = " one ": D0$(2)= " two "
640: print out grid
P = 1 2
910
& X = 1 4: get keyboard entries
"
550
, X
6" 850: clear bottom four lines
@? A(E(1),E(2)) = 0 A(E(3),E(4)) = 0 M = 1: 960: 410
J4 E(1) = E(3) E(2) = E(4) M = 2: 960: 440
T# E(3)*4+4,E(4)+3:A(E(3),E(4))
^ 0,8
h( A(E(1),E(2)) <> A(E(3),E(4)) 440
r 20
| A(E(1),E(2))=0
A(E(3),E(4)) = 0
B(P)=B(P)+1
E(1)*4+4,E(2)+3: " "
E(3)*4+4,E(4)+3: " "
450
2 E(1)*4+4,E(2)+3:" *": E(3)*4+4,E(4)+3:" *"
Q = P
# B(Q) = 5 910:*P 480 P
260
7 4,2;8,2;11,2;16,2;20,2;23,2;20,2;16,2;11,2;8,2;4,4
"Player "D0$(Q) "wins"
% 20,7: "Press 'A' to play again"
A7$ = : A7$ = "" 520
3 A7$ = "a" A7$ = "A" : 220 220,111:
& subroutine to select player input
&& 1,X+11: "player "D0$(P)" "
0@ X = 1 X = 3 14,X+11: "X coordinate? "
:@ X = 2 X = 4 14,X+11: "Y coordinate? "
D- X = 3 E(1)*4+4,E(2)+3: A(E(1),E(2))
N Q0$ = : Q0$ = "" 590
X E(X) = ((Q0$))
b 28,X+11: E(X)
lM E(X) <1 E(X)>8 1,X+11:"ILLEGAL - VALUE OUT OF LIMITS": 0,8: 550
v
subroutine to print grid
X = 1 8: label x axis
X*4+4,3:"X"X
X
Y = 1 8: label y axis
40,Y+3:"Y"Y
Y
X = 1 8
Y = 1 8
Y*4+5,X+3:"*"
Y
X
' initalise grid with random numbers
X = 1 8
Y = 1 8
* A(X,Y) = (*9)+1
4 Y
> X
H
R+ subroutine to clear bottom four lines
\ X = 1 4
f
1,X+11
p [A60 32]
z X
# subroutine to print out scores
G = 1 2
, G*25-15: "PLAYER "D0$(G) "score "B(G)
G
' error routine - possible cheating!
, M = 1: 1,12:"Number already selected"
: M = 2: 1,12:"You selected the same position twice!"
+ 1,13::"Your have just wasted a turn"
: X = 1 4: 1,1;3;1: X
850
A6=(N0$)
+ B1=A4+A6: TOT