MALTESE MALTESE$INSTRUN$!BOOT $ 3 #$/*BASIC
PAGE=&1900
*FX21,0
CLOSE#0:*RUN INSTRUN
N"
e3Ȣ v tutpuq |srprsqƩ ֩ / Bץu tǥt8(tuuLGu tti(tuiuLG `CHAIN"MALTESE"
Arrow keys: scroll ESCAPE: skip MALTESE CROSS MALTESE CROSS Maltese Cross is a popular domino game that you may already know. The rules aresimple and it can be played solo, against the computer, or with up to fourplayers. A demonstration is also possible and from this a few tactics of play can be learnt. The game is suitable for all ages, and comes as a welcome change from the fast action type or those needing complicatedkeyboard manoeuvres. During play the program tells you when and why a particular domino is not allowed, so if you don't already know the rules you soon will. You start by entering the number of players (1-4), and then give each player's name (up to eight characters). If the computer is to play a hand, type BBC for the first three letters for the player's name. For a demonstration the computer can be set to play itself by stating that two players called BBC1 and BBC2 are to play. The computer will then deal out the dominoes so that each player has an equal number, maximum 12, reserving at least two. These are placed face down when the game starts. All players, except the BBC, are given the opportunity to view their own dominoes and everyone else must look away from the screen as these are jotteddown on a piece of paper. If you are playing against the computer this is not necessary as at any time throughout the game you can view the state of your hand. The object is to be left with as few spots as possible at the end of the round, which stops as soon as a player runs out of dominoes or if each player passes in sequence. Each player's total number of spots willthen be added up, displayed, and points awarded. The rules are quite simple: The player who has the highest double ` usually the double six ` starts off. As this is a compulsory move the computer plays it straight away by placing it in the middle of the screen on top of the two face down dominoes. It then prompts for the next player in sequence to make his move by keying in the two values of his playing piece. Alternatively he can choose from the menu to see the scores, reveal his current hand, or pass the play to the next player. Dominoes must be played onto one of the four arms of the cross, which may be in any direction, N, S, E or W, and all four arms of the cross must be in position before any doubles can be played. No domino can be played unless the double of the linking number has alreadybeen played. For instance if the 3:6 domino can link onto an arm using the 3 end, the 3:3 must have already been played for this to be allowed. Finally, dominoes must be able to fit onthe screen (not usually a problem). The computer places any legal move on the correct arm and in the correct position.All illegal moves are reported with the reason given as to why they were rejected. If a choice is involved, the domino willbe placed on the shortest arm to providean even distribution of pieces. Occasionally the domino can link on bothits numbers, so the computer asks which end to link, as this could affect the outcome of the game. In such a case justtype in the linking value. The program uses all available memory inMode 1, so be very careful when typing in the listing. You must copy it exactly, being careful not to introduce unnecessary spaces. This makes the program a little difficult to read and follow, but in theend you will find the quality of the game well worth the effort. The program can be regarded as being in two parts. Part one displays an opening title page, then uses the downloader routine (loaded on function key f0 in line 40) to move the entire program to PAGE=&E00 if not there already. It also deletes the title procedure and all unnecessary lines to make enough room in the memory to run part two ` theactual game. As part of the program is deleted when you run it, you must save the final version before running it. The size of the spots on the dominoes defined in the program will give the best display for most TVs. If you preferto have the spots larger change line 1780 to read: 1780PLOT69,X,Y:PLOT69,X,Y-4:PLOT69,X+4,Y:PLOT69,X+4,Y-4:NEXT:ENDPROC Press ESCAPE Instructions digitised by lurkio @ stardot.org.uk/forums
MALTESE CROSS
by David Wale
The Micro User 1986.
(m*KEY0 DELETE10,80|M DELETE2190,2430|M*TAPE|MFORI%=0 TO TOP STEP4:I%!&E00=I%!PAGE:N.|MPAGE=&E00|MO.|MRUN|M
2=0:*FX200,3
<5:23;8202;0;0;0;:titles
F21:*FX138,0,128
P
U*FX200,3
Z>500
d' 6:1: DOM%(28),N$(4),S(4),C%(4)
n
x *FX18
130::0:P%=(-):*FX15,1
w3,7)"How many players for this game? ";:P%=-48:P%<2P%>47:3,9)"You must choose between 2 and 4":tL@ ;P%
t3,14)"Type 'BBC' for computer to play"''':K=1P%:'" Enter name of player ";K;:" "P$:N$(K)=P$,8):S(K)=0:
z19,2,3,0,0,0:TX=9.5:TY=9:LX=9:LY=7.5:BX=TX:BY=7:RX=11:RY=LY:K=128:DOM%(K)=-1::K=04:C%(K)=0::NG=0:23,1,0;0;0;0;
deal:PLR=1P%::N$(PLR),3)="BBC"t~@1,13)N$(PLR)''" Ensure nobody else can see, then press 'V' to note down your dominoes."''" Press 'F' when you have finished."
)B$=:B$="V"hand:tt@B$<>"F"tt@
:*FX200,2
screen:I=7
UI=I-1:PLR=DOM%(an(I,I)):PLR<1dR@DOM%(K)=0:TV=I:BV=I:LV=I:RV=I:CV=I:D1=I:D2=I
:0,2:Y=4805484:560,Y:696,Y::d(8.875,7.625,"HN")
play
pts:*FX21
{28,5,22,16,19:130:'"End of roundY=Another go";:A= 95:A=8926:t`@ A=78 :"Another.."3)"Game Y/N?"; dz@
%A= 95:A=89 A=78 !-4 TDA
play
PLR=PLR+1:PLR>P%PLR=1
"9D1=-1:28,5,22,16,19::131:N$(PLR):130:"to play?"
,0N$(PLR),3)="BBC"1,2)"-THINKING-";:d~F
6A=:D1=-1err(0)
@9A=127TbAA=83scores:TbAA=86hand:menu:TbA
J4A<>80NG=NG+1:NG=P%::"ALL PASSED. ";: TNA
T!A>54A<48TvAD2=A-48:;D2;
^D1=-1D1=D2:":";:TvA
h(DOM%(an(D1,D2))<>PLR err(1):TbA
r?LK1$=link(D1):LK2$=link(D2):LK1$=""LK2$=""err(2):TbA
|/LK1$<>LK2$tFAC%(4)=0err(3):TbAdVA
)D1<>BV D2<>BV C%(4)=0err(3):TbA
.LK2$<>""DOM%(an(D2,D2))<>0LK2$="":D3=D2
.LK1$<>""DOM%(an(D1,D1))<>0LK1$="":D3=D1
!LK1$=""LK2$=""err(4):TbA
LK1$<>""LK2$<>""txAdVA
70,2)"End to link?";:D3=-48:D3<>D1 D3<>D2 txA
D3=D1 P$=LK1$P$=LK2$
d`A
)LK1$<>""P$=LK1$:D3=D1 P$=LK2$:D3=D2
>NG=0:DOM%(an(D1,D2))=0:II:A=0:I=128:DOM%(I)=PLR A=A+1
:A>0TXA8,0)"OUT!":
+ ݤan(I,R):D3,A:K=0:D3=I:I12K=12
lPLR=1P%:I=1K
v+R=(28):DOM%(R)<>-1DvBDOM%(R)=PLR:
:
" hand:28,12,12,16,5:K=0:I=0
:K=K+1:DOM%(K)<>PLR trB
.I=628,24,27,29,19:130::28,26,28,29,22
!D1=dval(K):;D1;":";D2:I=I+1
K=28
A$=(50):A$="V"t|B
:28,12,12,16,5::26:
6 screen:19,2,6,0,0,0:0,130::0,0:29,576;448;
58,8:8,124:124,124:124,8:Y=81244:77,12,Y:
?12,0:124,0:16,-4:128,-4:132,4:132,120:136,0:136,116
"0,2:76,-4:68,4:68,128:0,0
menu:
+ menu:28,24,28,29,19:129:" MENU ";
6130:"V=view hand"'"S=show score"'"P=pass":26:
" scores:28,23,14,34,10:131
3K=1P%:N$(K);:P$=(S(K)):12-(P$),K-1)P$;:
*
C%(0)=9
42A$=(50):A$="S"TtC28,23,13,34,10:130::
>< err(K):28,23,13,34,10::K=028,5,22,16,19:9,1);:
H728,23,14,34,10:;D1":";D2" ";:131:"ILLEGAL":130
REK=1"You haven't"'"that domino!"K=2"Can't link"'"anywhere..."
\GK=3"Form the"'"Cross first!"K=4"Double ";D3;" notbeen played!"
f
p7 pts:28,12,14,16,7:"SPOTSLEFT:":A=1P%:C%(A)=0
z.I=128:DOM%(I)=A C%(A)=C%(A)+dval(I)+D2
:" ";C%(A)::K=P%-1
':TV=200:A=1P%:C%(A)"R"DBDCV=RV:C%(3)=C%(3)+1:A=1450
RY<>7.5d^C
9D1<>D2 dTCd(RX,7,"VN"):RX=RX+1:RX=17RX=16:RY=7
A
JRX=11RX=14d(RX,RY,"HN"):RX=RX+2:A RX=16:RY=6.5:d(RX,RY,"VN"):A
RX<>16TZD
D1=D2 TFD
>RY>=2RY=RY-2:d(RX,RY,"VN"):A RY>=1RY=RY-1:RX=15RX=14
d(RX,RY,"HR"):A
1RY-1>=0RY=RY-1:d(15.5,RY,"HN"):RY<1RX=15.5
A
D1=D2 TnD
$NRX-2>=0RX=RX-2:d(RX,RY,"HR"):A RX-1>=0RX=RX-1:d(RX,RY,"VR"):A TxD
.$RX-1>=0RX=RX-1:d(RX,0,"VR"):A
87:
B,P$<>"L"dDDCV=LV:C%(2)=C%(2)+1:A=1460
L?LY<>7.5DjDD1<>D2 D`DLX=LX-1:d(LX,7,"VN"):LX=3LY=9
VA
`FLX=9LX=6LX=LX-2:d(LX,LY,"HR"):A LX=3:d(LX,LY,"VR"):L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BY+1:A 7:
D1=CV RV=D2: RV=D1:
D1=CV LV=D2: LV=D1:
D1=CV TV=D2: TV=D1:
D1=CV BV=D2: BV=D1:
U d(XX,YY,P$):0,0:XX=XX*64:YY=YY*64:29,XX;YY;:L$=P$,1):P$=P$,1):P$="V"TbF
O120,4:8,4:8,60:128,60:128,8:0,3: Y=456:77,68,Y::0,0:68,4:68,60
W0,2:69,8,-4:69,12,-4:69,4,0:69,8,0:4,4:4,64:XX=448YY=4800,0128,64:0,0
*K=0:X=121244:X,-4)=0K=X+469,X,0
>:16,-4:128,-4:K>00,2:69,K,-4:69,K+4,-4:69,K,0:0,0
"Y=4564:140,Y)=269,132,Y
$:Y=0524:144,Y)=269,136,Y
:DhF
"N56,4:8,4:8,124:64,124:64,8:0,3:Y=4120:77,32,Y::0,0:8,64:64,64
,70,2:4,4:4,128:68,128:69,68,124:69,72,124:0,0
6+K=0:Y=1204-4:72,Y)=0K=Y-469,68,Y
@3:72,116:72,0:K>00,2:69,72,K:69,68,K:0,0
J X=12604:X,-4)=269,X,0
T#:X=16644:X,-8)=269,X,-4
^
hD1=CV L$="N"f(D1,D2)
rD2=CV L$="N"f(D2,D1)
|D1=CV L$="R"f(D2,D1)
D2=CV L$="R"f(D1,D2)
0,0:
f(D1,D2)
\P$="H"dot(D1,P$):29,XX+64;YY;:dot(D2,P$): dot(D2,P$):29,XX;YY+60;:dot(D1,P$):
dot(K,P$):K=0
"36,36,24,48,48,24,48,48,24,24
24,48,48,24,24,24,48,48
(20,48,36,48,52,48,20,24,36,24,52,24
K=6dLFtxF
K=2K=4dBF
#I=1K:P$="V"Y,X:X=72-X X,Y
69,X,Y:69,X,Y-4::
X=0:Y=0: BBC PLAY
A=128:DOM%(A)<>PLR DbG
6D1=dval(A):LK1$=link(D1):LK2$=link(D2):H%=D1+D2
LK1$=LK2$C%(4)=0DbG
&LK1$=LK2$DDG
0DOM%(an(D1,D1))<>0LK1$=""
:DOM%(an(D2,D2))<>0LK2$=""
DLK1$=""LK2$=""DbG
NLK1$<>""wgt(D1)
XLK2$<>""wgt(D2)
bA
lX=0A=80:DJA: PASS
vD1=dval(Y):d`A: PLAY
/ p(R):X=R:Y=A:D3=I:D3=D1 P$=LK1$P$=LK2$
lead:XX=0:YY=0:D3:D3=I
I=D1 I<>D2 D3=D2
I<>D1 I=D2 D3=D1
A,D1,D2
A=128:DOM%(A)<>PLR ddG
D1=dval(A)
D3=D1 D3=D2 XX=XX+1
&D3=D1 D3=D2 YY=1:(D1+D2)>=8YY=8
A:
# wgt(I):lead:LK1$=LK2$DHH
C%(4)=0H%>8DpH
X<8p(8)
H%>8X<9p(9)
XX>1X<10p(10)
XX>1H%>8X<11p(11)
*YY>0X<12p(12)
4YY=8X<13p(13)
>
HX0X<15p(15)
\NG>0XX>1X<16p(16)
f
pYY>0p(18)p(17)
zYY=8p(19)
titles
D19,0,5,0,0,0:19,1,5,0,0,0:19,2,5,0,0,0:19,3,5,0,0,0:0,130:
!0,128:24,400;336;624;816;:
24,656;336;880;816;:
!0,130:24,400;456;880;696;:
!0,131:24,400;464;880;688;:
Y0,0:400,464:400,688:880,688:880,464:400,464:400,468:880,468:400,684:880,684
40,1:5:416,624:"MALTESE":480,560:"CROSS":4
0TD(528,832,752,1023):29,528;832;:VDOM:26
,TD(528,0,752,316):29,528;72;:VDOM:26
;TD(0,464,368,688):29,128;464;:HDOM:TS(-120,122):26
ITD(912,464,1279,688):29,912;464;:HDOM:TS(300,72):TS(300,172):26
-19,0,0,0,0,0:19,1,1,0,0,0:19,3,7,0,0,0
30:130:13,24)"by"14,26)"David"14,27)"Wale"
R24,272,T,120,272,H,216,272,E,40,224,M,136,224,I,232,224,C,328,224,R,424,224,O
$+80,176,U,176,176,S,272,176,E,368,176,R
.V23,224,255,255,255,255,255,255,255,255:5:TZI:L=112:0,1:X,Y,A$:X,Y:(224)
8[X,Y+8:X+72,Y+8:X,Y+4:X+72,Y+4:X+72,Y-32:X+64,Y:X+64,Y-32:0,0:X-4,Y-32:X-4,Y+4
BX+8,Y:0,3:A$::4
L
VN TD(X,Y,XX,YY):0,128:24,X;Y;XX;YY;::0,131:24,X+8;Y+8;XX-8;YY-8;::
`9:MOVEX,Y:DRAWX,YY:DRAWXX,YY:DRAWXX,Y:DRAWX,Y:ENDPROC
jr VDOM:0,4:224,4:0,240:224,240:TS(60,60):TS(60,128):TS(60,192):TS(156,192):TS(156,128):TS(156,60):
tr HDOM:0,0:0,220:240,0:240,220:TS(52,72):TS(120,72):TS(184,72):TS(184,172):TS(120,172):TS(52,172):
~K TS(X,Y):0,0:X,Y:X,Y-16:X+16,Y-16:85,X,Y:X+16,Y:85,X+16,Y-16: