Home » Personal collection » Acorn ADFS disks » Electron » Digital_pictures_2.ADF » GAMES1/DOMINOS

GAMES1/DOMINOS

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron » Digital_pictures_2.ADF
Filename: GAMES1/DOMINOS
Read OK:
File size: 17CA bytes
Load address: FFFF0E00
Exec address: FFFF8023
File contents
   10REM DOMINOES
   20REM ELBUG APRIL 1984
   60:
  100ON ERROR GOTO 430
  120CLEAR
  130*FX11,0
  140MODE1
  150VDU23,1,0;0;0;0;
  160PROCinit 
  170PROCshuffle
  180PROCstart
  190REPEAT 
  200WT=FALSE
  210PROCshuffle:S%=0
  220GCOL0,129:CLG  
  230VDU28,0,31,14,26,12,18,0,0,25,4,480;188;25,5,1279;188;
  240FOR I%=1 TO 9
  250MOVE29,1023-I%*80:PLOT25,1221,0
  260IF (I% MOD2 AND I%<9) PLOT25,0,-80 ELSE IF I%<9 PLOT0,-1221,0:PLOT25,0,-80
  270NEXT
  280FOR I%=0TO1
  290PROCpick(I%,7):end%(I%)=-1:endl%(I%)=3
  300NEXT
  310WT=TRUE
  320REPEAT
  330IF ELK% PROCELK ELSE PROCdisphand(1,0):PROCplayer
  340UNTIL tot%(0)=0 OR tot%(1)=0 OR (bk% AND pk% AND S%>27)
  350I%=0:W%=0:REPEAT
  360IF tot%(I%)=0 PROCwin(I%):W%=1
  370I%=I%+1
  380UNTIL W% OR I%=2
  390IF W%=0 W%=FNwin:PROCwin(W%) 
  400UNTIL FALSE
  410END
  420:
  430ON ERROR OFF:MODE6
  440*FX12
  450IF ERR<>17 REPORT:PRINT" at line ";ERL
  460END
  470:
 1000DEFPROCinit
 1010DIMdom$(27),hand$(1,9),tot%(1),end%(1),endl%(1),endx%(1),win%(2),th%(1)
 1020A%=RND(TIME)
 1030FOR I%=0TO1
 1040tot%(I%)=0
 1050FOR K%=0TO9
 1060 hand$(I%,K%)="  "
 1070NEXT:NEXT
 1080FOR I%=0TO2:win%(I%)=0:NEXT
 1090VDU23,255,0;0;32,112,32,0
 1100VDU19,1,2,0,0,0:VDU19,2,1,0,0,0
 1110bk%=0:pk%=0
 1120ENDPROC
 1130:
 1140DEFPROCshuffle
 1150RESTORE1280
 1160LOCAL N%,I%
 1170FOR N%=0TO27
 1180dom$(N%)="  "
 1190NEXT
 1200FOR N%=0TO27
 1210REPEAT
 1220I%=RND(28)-1
 1230UNTIL dom$(I%)="  "
 1240READdom$(I%)
 1250NEXT
 1260ENDPROC
 1270:
 1280DATA00,01,02,03,04,05,06,11,12,13,14,15,22,23,24,25,26,33,34,35,36,44,45,46,55,56,66
 1290:
 1300DEFPROCstart
 1310LOCAL B%,bd%,P%,N%,pd%,s$,t$
 1320CLS
 1330PRINTTAB(16,1)"DOMINOES"
 1340PRINT''"Welcome to ELKDOM."''"Please give me your name:"'
 1350REPEAT:INPUTTAB(0,8)n$:L%=LEN(n$):IF L%>10 PRINTTAB(0,8)SPCL%
 1360UNTIL L%<11
 1370PRINT''"Hello ";n$;"."
 1380PRINT"Please enter a number (1-28) to select"''"a domino, the ELK will also choose -"''"the highest number of dots starts!"
 1390REPEAT:INPUTTAB(0,19)P%:P%=P%-1:UNTIL P%<28 AND P%>=0
 1400pd%=FNtotdot(P%)
 1410REPEAT
 1420B%=RND(28)-1
 1430bd%=FNtotdot(B%):s$="ELK"
 1440UNTIL C%<>B% AND pd%<>bd%
 1450 PROCdomino(320,320,TRUE,FNldot(dom$(P%)),FNrdot(dom$(B%))):PROCdomino(960,320,TRUE,FNldot(dom$(B%)),FNrdot(dom$(B%)))    
 1460PRINTTAB(0,26)SPC(10-LEN(n$)DIV2);n$;SPC(17-LEN(n$)DIV2);s$
 1470IF bd%>pd% ELK%=TRUE ELSE ELK%=FALSE:s$=n$
 1480PRINT's$;" starts!"''"Press any key to continue."
 1490P%=GET
 1500ENDPROC
 1520DEFFNtotdot(N%)=FNldot(dom$(N%))+FNrdot(dom$(N%))
 1530:
 1540DEFFNldot(D$)=VAL(LEFT$(D$,1))
 1550:
 1560DEFFNrdot(D$)=VAL(RIGHT$(D$,1)) 
 1570:
 1580DEFPROCdomino(X%,Y%,O%,L%,R%)
 1590LOCAL N%,D%
 1600GCOL0,2:IF O% MOVEX%-30,Y%-6:PLOT0,0,12:PLOT 81,60,-12:PLOT81,0,12 ELSE MOVEX%-6,Y%-30:PLOT0,12,0:PLOT81,-12,60:PLOT81,12,0
 1610FOR N%=-1 TO 1 STEP 2
 1620GCOL0,3:IF O% MOVEX%+N%*30,Y%+N%*66 ELSE MOVE X%+N%*66,Y%+N%*30
 1630PLOT0,-60*N%,0:PLOT81,60*N%,-60*N%:PLOT81,-60*N%,0
 1640NEXT
 1650O%=ABS(O%)
 1660FOR N%=-1 TO 1 STEP 2 
 1670H%=O%*(X%-8)-(O%-1)*((X%-8)+N%*36)
 1680V%=O%*((Y%+18)+N%*36)-(O%-1)*(Y%+18) 
 1690IF N%=-1 D%=L% ELSE D%=R%
 1700VDU5:PROCdot(H%,V%,D%)
 1710NEXT
 1720VDU4
 1730ENDPROC
 1740:
 1750DEFPROCdot(X%,Y%,T%)
 1760LOCAL N%,M%,D%,A%,H%,V%
 1770M%=T%MOD2:D%=T%DIV2
 1780GCOL4,0:MOVEX%,Y%
 1790IF M% PRINT CHR$255;
 1800IF D%=0 ENDPROC
 1810IF O% RESTORE1940 ELSE RESTORE1950
 1820N%=0
 1830REPEAT
 1840READA%:N%=N%+1
 1850UNTIL N%=D%
 1860RESTORE1960
 1870FOR N%=1TO8
 1880READH%,V%,Q%
 1890MOVEX%,Y%:PLOT0,H%,V%
 1900IF Q% AND A% PRINT CHR$255
 1910NEXT 
 1920ENDPROC
 1930:
 1940DATA&44,&55,&DD
 1950DATA&11,&55,&77  
 1960DATA-20,20,1,0,20,2,20,20,4,20,0,8,20,-20,&10,0,-20,&20,-20,-20,&40,-20,0,&80
 1970:
 1980DEFPROCpick(P%,D%)
 1990LOCAL N%
 2000FOR N%=1 TO D%
 2010IF S%>27 D%=N% ELSE hand$(P%,tot%(P%))=dom$(S%):S%=S%+1:PROCsound
 2020NEXT
 2030ENDPROC
 2040:
 2050DEFPROCdisphand(P%,T%)
 2060VDU24,500;0+T%*184;1279;184+T%*184;16
 2070LOCAL N%,X%
 2080IF tot%(P%)=0 VDU26:ENDPROC
 2090FOR N%=0 TO tot%(P%)-1
 2100X%=532+(N%)*72
 2110PROCdomino(X%,80+T%*184,TRUE,FNldot(hand$(P%,N%)),FNrdot(hand$(P%,N%)))
 2120MOVEX%-10,180+T%*184
 2130VDU5
 2140IF T%=0 PRINT;N%
 2150NEXT:IF T%=0 VDU4,24,0;196;1279;1023; ELSE VDU4,26 
 2160ENDPROC
 2170:
 2180DEFPROCELK
 2190LOCAL E%,N%,D%,O%,L%,R%,P%:ELK%=FALSE:bk%=0
 2200IF end%(0)=-1 X%=640:Y%=623:D%=FN1st:L%=FNldot(hand$(0,D%)):R%=FNrdot(hand$(0,D%)):end%(0)=L%:end%(1)=R%:O%=(L%=R%):P%=1:FOR E%=0TO1:endx%(E%)=640+FNcentre:PROCendno(E%):NEXT ELSE PROCplay:PROCendno(E%) 
 2210IF P% PROCdomino(X%,Y%,O%,L%,R%):PROCsort(0,D%) ELSE PROCpick(0,1):bk%=1
 2220ENDPROC
 2230:
 2240DEFFNvert(D$)
 2250IF FNldot(D$)=FNrdot(D$)=TRUE ELSE =FALSE
 2260:
 2270DEFPROCplayer
 2280LOCAL E%,B%,F%,N%,D%,X%,Y%,O%,I%,J%,L%,R%:ELK%=TRUE:pk%=0
 2290PRINT'"Press number"'"for domino"'"you wish to"'"play.(k=Knock)"
 2300REPEAT:D%=GET-48:UNTIL(D%>=0 AND D%<tot%(1))OR D%=59 OR D%=27:IF D%>tot%(1)PROCpick(1,1):pk%=1:ENDPROC
 2310I%=FNldot(hand$(1,D%)):J%=FNrdot(hand$(1,D%)):O%=FNvert(hand$(1,D%))
 2320IF end%(0)=-1 X%=640:Y%=623:L%=I%:R%=J%:end%(0)=L%:end%(1)=R%:P%=TRUE:FOR E%=0TO1:endx%(E%)=640+FNcentre:PROCendno(E%):NEXT:GOTO2370
 2330IF end%(0)<>-1 CLS:PRINT'"Press number"'"for end"'"you wish to"'"play.":REPEAT:E%=GET-49:UNTIL E%=0 OR E%=1 
 2340IF I%=end%(E%) B%=0:F%=1
 2350IF J%=end%(E%) B%=1:F%=1
 2360IF F% PROCendno(E%):PROCarrange(B%):PROCsetup(E%):PROCendno(E%)
 2370IF P% PROCdomino(X%,Y%,O%,L%,R%):PROCsort(1,D%) ELSE PROCpick(1,1):pk%=1
 2380IF WT SOUND0,-15,100,6
 2390IF WT G=INKEY(100)
 2400ENDPROC
 2410:
 2420DEFPROCplay
 2430LOCAL I%,i%,J%,j%,K%,B%,T%,M%:E%=-1
 2440FOR M%=0TO tot%(0)-1
 2450i%=FNldot(hand$(0,M%)):j%=FNrdot(hand$(0,M%))
 2460FOR K%=0 TO 1
 2470IF i%=end%(K%) AND T%<=i%+j% PROCsave:B%=0
 2480IF j%=end%(K%) AND T%<=i%+j% PROCsave:B%=1
 2490NEXT:NEXT
 2500O%=FNvert(hand$(0,D%))
 2510IF E%>-1 PROCendno(E%):PROCarrange(B%):PROCsetup(E%)
 2520ENDPROC
 2530:
 2540DEFPROCsave:D%=M%:T%=i%+j%:I%=i%:J%=j%:E%=K%:ENDPROC
 2550:
 2560DEFPROCsetup(E%)
 2570LOCAL C%,W%
 2580P%=1:C%=FNcentre:X%=endx%(E%)+C%:W%=endx%(E%)+2*C%+8*SGN(C%)
 2590IF W%<7 OR W%>1271 endl%(E%)=endl%(E%)+SGN(C%):X%=C%-1279*(E%=0):endx%(E%)=W%-endx%(E%)-1279*(E%=0) ELSE endx%(E%)=W%
 2600Y%=1103-endl%(E%)*160
 2610ENDPROC
 2620:
 2630DEFFNcentre=-((O%=0)*70+(O%=TRUE)*34)*((E%=0)-(E%=1))  
 2640:
 2650DEFPROCsort(P%,D%)
 2660LOCAL N%,T%
 2670IF tot%(P%)<10 T%=tot%(P%)-1 ELSE T%=8:hand$(P%,9)"  "
 2680FOR N%=D%TO T% 
 2690hand$(P%,N%)=hand$(P%,N%+1)
 2700NEXT
 2710tot%(P%)=tot%(P%)-1
 2720ENDPROC
 2730:
 2740DEFPROCarrange(F%)
 2750IF F%=0 end%(E%)=J% ELSE end%(E%)=I%
 2760IF F%=E% R%=I%:L%=J% ELSE L%=I%:R%=J%
 2770ENDPROC
 2780:
 2790DEFFN1st
 2800LOCAL N%,T%,H%,I%
 2810FOR N%=1TO7
 2820T%=FNtotdot(N%-1):IF T%>H% H%=T%:I%=N%-1
 2830NEXT:=I%
 2840:
 2850DEFPROCendno(E%)
 2860IF E%=-1 ENDPROC ELSE VDU5:GCOL4,0:MOVEendx%(E%)+30*(E%=0),1115-endl%(E%)*160:PRINT;E%+1:VDU4
 2870ENDPROC
 2880:
 2890DEFFNwin
 2900LOCAL N%,I%
 2910FOR N%=0TO1
 2920th%(N%)=0
 2930FOR I%=0TO tot%(N%)-1
 2940th%(N%)=th%(N%)+FNldot(hand$(N%,I%))+FNrdot(hand$(N%,I%))
 2950NEXT:NEXT
 2960IF th%(0)>th%(1) =1
 2970IF th%(1)>th%(0) =0 ELSE =2
 2980:
 2990DEFPROCwin(W%)
 3000VDU26,12
 3010LOCAL N%
 3020IF W%=0:ELK%=TRUE:W$="ELK" 
 3030IF W%=1:ELK%=FALSE:W$=n$
 3040IF W%<2 PRINT'"The WINNER is ";W$ ELSE PRINT'"Game Drawn!"
 3050PRINT''"State of play:"
 3060win%(W%)=win%(W%)+1
 3070PRINT''SPC(6);"ELK";SPC(10-LEN(n$)DIV2+LEN(n$)MOD2);n$;SPC(10-LEN(n$)DIV2);"Drawn"''SPC(2);
 3080FOR N%=0TO2
 3090PRINT;SPC(7);win%(N%);
 3100NEXT
 3110PRINT''"Unplayed hands: "''''n$''''''"ELK"'''
 3120PRINT''"Press any key to continue."
 3130FOR N%=1TO2:PROCdisphand(N%-1,N%):tot%(N%-1)=0:NEXT
 3140k=GET
 3150ENDPROC
 3160:
 3170DEFPROCsound
 3180IF WT SOUND1,-15,100,4:SOUND1,-15,10,6
 3190IF WT G=INKEY(100)
 3200IF tot%(P%)<9 tot%(P%)=tot%(P%)+1
 3210ENDPROC

� DOMINOES
� ELBUG APRIL 1984
<:
d� � � �tnA
x�
�*FX11,0
��1
��23,1,0;0;0;0;
�
�init 
��shuffle
�
�start
�� 
�WT=�
��shuffle:S%=0
��0,129:�  
�8�28,0,31,14,26,12,18,0,0,25,4,480;188;25,5,1279;188;
�� I%=1 � 9
��29,1023-I%*80:�25,1221,0
<� (I% �2 � I%<9) �25,0,-80 � � I%<9 �0,-1221,0:�25,0,-80
�
� I%=0�1
"'�pick(I%,7):end%(I%)=-1:endl%(I%)=3
,�
6WT=�
@�
J(� ELK% �ELK � �disphand(1,0):�player
T1� tot%(0)=0 � tot%(1)=0 � (bk% � pk% � S%>27)
^I%=0:W%=0:�
h� tot%(I%)=0 �win(I%):W%=1
rI%=I%+1
|� W% � I%=2
�� W%=0 W%=�win:�win(W%) 
�� �
��
�:
�� � �:�6
�	*FX12
�� �<>17 �:�" at line ";�
��
�:
�
��init
�I�dom$(27),hand$(1,9),tot%(1),end%(1),endl%(1),endx%(1),win%(2),th%(1)
�A%=�(�)
� I%=0�1
tot%(I%)=0
� K%=0�9
$ hand$(I%,K%)="  "
.�:�
8� I%=0�2:win%(I%)=0:�
B�23,255,0;0;32,112,32,0
L�19,1,2,0,0,0:�19,2,1,0,0,0
Vbk%=0:pk%=0
`�
j:
t
��shuffle
~	��T@E
�� N%,I%
�
� N%=0�27
�dom$(N%)="  "
��
�
� N%=0�27
��
�I%=�(28)-1
�� dom$(I%)="  "
�
�dom$(I%)
��
��
�:
U�00,01,02,03,04,05,06,11,12,13,14,15,22,23,24,25,26,33,34,35,36,44,45,46,55,56,66

:
��start
� B%,bd%,P%,N%,pd%,s$,t$
(�
2�16,1)"DOMINOES"
<9�''"Welcome to ELKDOM."''"Please give me your name:"'
F)�:�0,8)n$:L%=�(n$):� L%>10 �0,8)�L%
P� L%<11
Z�''"Hello ";n$;"."
d{�"Please enter a number (1-28) to select"''"a domino, the ELK will also choose -"''"the highest number of dots starts!"
n'�:�0,19)P%:P%=P%-1:� P%<28 � P%>=0
xpd%=�totdot(P%)
��
�B%=�(28)-1
�bd%=�totdot(B%):s$="ELK"
�� C%<>B% � pd%<>bd%
�n �domino(320,320,�,�ldot(dom$(P%)),�rdot(dom$(B%))):�domino(960,320,�,�ldot(dom$(B%)),�rdot(dom$(B%)))    
�,�0,26)�(10-�(n$)�2);n$;�(17-�(n$)�2);s$
�#� bd%>pd% ELK%=� � ELK%=�:s$=n$
�1�'s$;" starts!"''"Press any key to continue."
�P%=�
��
�0ݤtotdot(N%)=�ldot(dom$(N%))+�rdot(dom$(N%))
�:
ݤldot(D$)=�(�D$,1))
:
ݤrdot(D$)=�(�D$,1)) 
":
,��domino(X%,Y%,O%,L%,R%)
6� N%,D%
@`�0,2:� O% �X%-30,Y%-6:�0,0,12:� 81,60,-12:�81,0,12 � �X%-6,Y%-30:�0,12,0:�81,-12,60:�81,12,0
J� N%=-1 � 1 � 2
T6�0,3:� O% �X%+N%*30,Y%+N%*66 � � X%+N%*66,Y%+N%*30
^-�0,-60*N%,0:�81,60*N%,-60*N%:�81,-60*N%,0
h�
rO%=�(O%)
|� N%=-1 � 1 � 2 
�&H%=O%*(X%-8)-(O%-1)*((X%-8)+N%*36)
�)V%=O%*((Y%+18)+N%*36)-(O%-1)*(Y%+18) 
�� N%=-1 D%=L% � D%=R%
��5:�dot(H%,V%,D%)
��
��4
��
�:
���dot(X%,Y%,T%)
�� N%,M%,D%,A%,H%,V%
�M%=T%�2:D%=T%�2
��4,0:�X%,Y%
�� M% � �255;
� D%=0 �
� O% ��tTG � ��t^G
N%=0
&�
0�A%:N%=N%+1
:� N%=D%
D	��thG
N� N%=1�8
X
�H%,V%,Q%
b�X%,Y%:�0,H%,V%
l� Q% � A% � �255
v� 
��
�:
��&44,&55,&DD
��&11,&55,&77  
�N�-20,20,1,0,20,2,20,20,4,20,0,8,20,-20,&10,0,-20,&20,-20,-20,&40,-20,0,&80
�:
���pick(P%,D%)
�� N%
�� N%=1 � D%
�>� S%>27 D%=N% � hand$(P%,tot%(P%))=dom$(S%):S%=S%+1:�sound
��
��
�:
��disphand(P%,T%)
'�24,500;0+T%*184;1279;184+T%*184;16
� N%,X%
 � tot%(P%)=0 �26:�
*� N%=0 � tot%(P%)-1
4X%=532+(N%)*72
>C�domino(X%,80+T%*184,�,�ldot(hand$(P%,N%)),�rdot(hand$(P%,N%)))
H�X%-10,180+T%*184
R�5
\� T%=0 �;N%
f,�:� T%=0 �4,24,0;196;1279;1023; � �4,26 
p�
z:
�	��ELK
�'� E%,N%,D%,O%,L%,R%,P%:ELK%=�:bk%=0
��� end%(0)=-1 X%=640:Y%=623:D%=�1st:L%=�ldot(hand$(0,D%)):R%=�rdot(hand$(0,D%)):end%(0)=L%:end%(1)=R%:O%=(L%=R%):P%=1:� E%=0�1:endx%(E%)=640+�centre:�endno(E%):� � �play:�endno(E%) 
�?� P% �domino(X%,Y%,O%,L%,R%):�sort(0,D%) � �pick(0,1):bk%=1
��
�:
�ݤvert(D$)
� � �ldot(D$)=�rdot(D$)=� � =�
�:
���player
�6� E%,B%,F%,N%,D%,X%,Y%,O%,I%,J%,L%,R%:ELK%=�:pk%=0
�@�'"Press number"'"for domino"'"you wish to"'"play.(k=Knock)"
�Q�:D%=�-48:�(D%>=0 � D%<tot%(1))� D%=59 � D%=27:� D%>tot%(1)�pick(1,1):pk%=1:�
	EI%=�ldot(hand$(1,D%)):J%=�rdot(hand$(1,D%)):O%=�vert(hand$(1,D%))
	w� end%(0)=-1 X%=640:Y%=623:L%=I%:R%=J%:end%(0)=L%:end%(1)=R%:P%=�:� E%=0�1:endx%(E%)=640+�centre:�endno(E%):�:�DBI
	]� end%(0)<>-1 �:�'"Press number"'"for end"'"you wish to"'"play.":�:E%=�-49:� E%=0 � E%=1 
	$� I%=end%(E%) B%=0:F%=1
	.� J%=end%(E%) B%=1:F%=1
	86� F% �endno(E%):�arrange(B%):�setup(E%):�endno(E%)
	B?� P% �domino(X%,Y%,O%,L%,R%):�sort(1,D%) � �pick(1,1):pk%=1
	L� WT �0,-15,100,6
	V� WT G=�(100)
	`�
	j:
	t
��play
	~#� I%,i%,J%,j%,K%,B%,T%,M%:E%=-1
	�� M%=0� tot%(0)-1
	�/i%=�ldot(hand$(0,M%)):j%=�rdot(hand$(0,M%))
	�� K%=0 � 1
	�(� i%=end%(K%) � T%<=i%+j% �save:B%=0
	�(� j%=end%(K%) � T%<=i%+j% �save:B%=1
	��:�
	�O%=�vert(hand$(0,D%))
	�.� E%>-1 �endno(E%):�arrange(B%):�setup(E%)
	��
	�:
	�-��save:D%=M%:T%=i%+j%:I%=i%:J%=j%:E%=K%:�
	�:
��setup(E%)

� C%,W%
=P%=1:C%=�centre:X%=endx%(E%)+C%:W%=endx%(E%)+2*C%+8*�(C%)
r� W%<7 � W%>1271 endl%(E%)=endl%(E%)+�(C%):X%=C%-1279*(E%=0):endx%(E%)=W%-endx%(E%)-1279*(E%=0) � endx%(E%)=W%
(Y%=1103-endl%(E%)*160
2�
<:
F5ݤcentre=-((O%=0)*70+(O%=�)*34)*((E%=0)-(E%=1))  
P:
Z��sort(P%,D%)
d� N%,T%
n6� tot%(P%)<10 T%=tot%(P%)-1 � T%=8:hand$(P%,9)"  "
x� N%=D%� T% 
�hand$(P%,N%)=hand$(P%,N%+1)
��
�tot%(P%)=tot%(P%)-1
��
�:
���arrange(F%)
�$� F%=0 end%(E%)=J% � end%(E%)=I%
�%� F%=E% R%=I%:L%=J% � L%=I%:R%=J%
��
�:
�	ݤ1st
�� N%,T%,H%,I%
�� N%=1�7
*T%=�totdot(N%-1):� T%>H% H%=T%:I%=N%-1
	�:=I%
:
"��endno(E%)
,I� E%=-1 � � �5:�4,0:�endx%(E%)+30*(E%=0),1115-endl%(E%)*160:�;E%+1:�4
6�
@:
J	ݤwin
T� N%,I%
^� N%=0�1
h
th%(N%)=0
r� I%=0� tot%(N%)-1
|;th%(N%)=th%(N%)+�ldot(hand$(N%,I%))+�rdot(hand$(N%,I%))
��:�
�� th%(0)>th%(1) =1
�� th%(1)>th%(0) =0 � =2
�:
�
��win(W%)
�
�26,12
�� N%
�� W%=0:ELK%=�:W$="ELK" 
�� W%=1:ELK%=�:W$=n$
�2� W%<2 �'"The WINNER is ";W$ � �'"Game Drawn!"
��''"State of play:"
�win%(W%)=win%(W%)+1
�G�''�(6);"ELK";�(10-�(n$)�2+�(n$)�2);n$;�(10-�(n$)�2);"Drawn"''�(2);
� N%=0�2
�;�(7);win%(N%);
�
&-�''"Unplayed hands: "''''n$''''''"ELK"'''
0#�''"Press any key to continue."
:.� N%=1�2:�disphand(N%-1,N%):tot%(N%-1)=0:�
Dk=�
N�
X:
b��sound
l!� WT �1,-15,100,4:�1,-15,10,6
v� WT G=�(100)
�$� tot%(P%)<9 tot%(P%)=tot%(P%)+1
��
�
00000000  0d 00 0a 0e f4 20 44 4f  4d 49 4e 4f 45 53 0d 00  |..... DOMINOES..|
00000010  14 16 f4 20 45 4c 42 55  47 20 41 50 52 49 4c 20  |... ELBUG APRIL |
00000020  31 39 38 34 0d 00 3c 05  3a 0d 00 64 0e ee 20 85  |1984..<.:..d.. .|
00000030  20 e5 20 8d 74 6e 41 0d  00 78 05 d8 0d 00 82 0b  | . .tnA..x......|
00000040  2a 46 58 31 31 2c 30 0d  00 8c 06 eb 31 0d 00 96  |*FX11,0.....1...|
00000050  12 ef 32 33 2c 31 2c 30  3b 30 3b 30 3b 30 3b 0d  |..23,1,0;0;0;0;.|
00000060  00 a0 0a f2 69 6e 69 74  20 0d 00 aa 0c f2 73 68  |....init .....sh|
00000070  75 66 66 6c 65 0d 00 b4  0a f2 73 74 61 72 74 0d  |uffle.....start.|
00000080  00 be 06 f5 20 0d 00 c8  08 57 54 3d a3 0d 00 d2  |.... ....WT=....|
00000090  11 f2 73 68 75 66 66 6c  65 3a 53 25 3d 30 0d 00  |..shuffle:S%=0..|
000000a0  dc 0e e6 30 2c 31 32 39  3a da 20 20 0d 00 e6 38  |...0,129:.  ...8|
000000b0  ef 32 38 2c 30 2c 33 31  2c 31 34 2c 32 36 2c 31  |.28,0,31,14,26,1|
000000c0  32 2c 31 38 2c 30 2c 30  2c 32 35 2c 34 2c 34 38  |2,18,0,0,25,4,48|
000000d0  30 3b 31 38 38 3b 32 35  2c 35 2c 31 32 37 39 3b  |0;188;25,5,1279;|
000000e0  31 38 38 3b 0d 00 f0 0e  e3 20 49 25 3d 31 20 b8  |188;..... I%=1 .|
000000f0  20 39 0d 00 fa 1d ec 32  39 2c 31 30 32 33 2d 49  | 9.....29,1023-I|
00000100  25 2a 38 30 3a f0 32 35  2c 31 32 32 31 2c 30 0d  |%*80:.25,1221,0.|
00000110  01 04 3c e7 20 28 49 25  20 83 32 20 80 20 49 25  |..<. (I% .2 . I%|
00000120  3c 39 29 20 f0 32 35 2c  30 2c 2d 38 30 20 8b 20  |<9) .25,0,-80 . |
00000130  e7 20 49 25 3c 39 20 f0  30 2c 2d 31 32 32 31 2c  |. I%<9 .0,-1221,|
00000140  30 3a f0 32 35 2c 30 2c  2d 38 30 0d 01 0e 05 ed  |0:.25,0,-80.....|
00000150  0d 01 18 0c e3 20 49 25  3d 30 b8 31 0d 01 22 27  |..... I%=0.1.."'|
00000160  f2 70 69 63 6b 28 49 25  2c 37 29 3a 65 6e 64 25  |.pick(I%,7):end%|
00000170  28 49 25 29 3d 2d 31 3a  65 6e 64 6c 25 28 49 25  |(I%)=-1:endl%(I%|
00000180  29 3d 33 0d 01 2c 05 ed  0d 01 36 08 57 54 3d b9  |)=3..,....6.WT=.|
00000190  0d 01 40 05 f5 0d 01 4a  28 e7 20 45 4c 4b 25 20  |..@....J(. ELK% |
000001a0  f2 45 4c 4b 20 8b 20 f2  64 69 73 70 68 61 6e 64  |.ELK . .disphand|
000001b0  28 31 2c 30 29 3a f2 70  6c 61 79 65 72 0d 01 54  |(1,0):.player..T|
000001c0  31 fd 20 74 6f 74 25 28  30 29 3d 30 20 84 20 74  |1. tot%(0)=0 . t|
000001d0  6f 74 25 28 31 29 3d 30  20 84 20 28 62 6b 25 20  |ot%(1)=0 . (bk% |
000001e0  80 20 70 6b 25 20 80 20  53 25 3e 32 37 29 0d 01  |. pk% . S%>27)..|
000001f0  5e 0f 49 25 3d 30 3a 57  25 3d 30 3a f5 0d 01 68  |^.I%=0:W%=0:...h|
00000200  1e e7 20 74 6f 74 25 28  49 25 29 3d 30 20 f2 77  |.. tot%(I%)=0 .w|
00000210  69 6e 28 49 25 29 3a 57  25 3d 31 0d 01 72 0b 49  |in(I%):W%=1..r.I|
00000220  25 3d 49 25 2b 31 0d 01  7c 0f fd 20 57 25 20 84  |%=I%+1..|.. W% .|
00000230  20 49 25 3d 32 0d 01 86  1c e7 20 57 25 3d 30 20  | I%=2..... W%=0 |
00000240  57 25 3d a4 77 69 6e 3a  f2 77 69 6e 28 57 25 29  |W%=.win:.win(W%)|
00000250  20 0d 01 90 07 fd 20 a3  0d 01 9a 05 e0 0d 01 a4  | ..... .........|
00000260  05 3a 0d 01 ae 0c ee 20  85 20 87 3a eb 36 0d 01  |.:..... . .:.6..|
00000270  b8 09 2a 46 58 31 32 0d  01 c2 1c e7 20 9f 3c 3e  |..*FX12..... .<>|
00000280  31 37 20 f6 3a f1 22 20  61 74 20 6c 69 6e 65 20  |17 .:." at line |
00000290  22 3b 9e 0d 01 cc 05 e0  0d 01 d6 05 3a 0d 03 e8  |";..........:...|
000002a0  0a dd f2 69 6e 69 74 0d  03 f2 49 de 64 6f 6d 24  |...init...I.dom$|
000002b0  28 32 37 29 2c 68 61 6e  64 24 28 31 2c 39 29 2c  |(27),hand$(1,9),|
000002c0  74 6f 74 25 28 31 29 2c  65 6e 64 25 28 31 29 2c  |tot%(1),end%(1),|
000002d0  65 6e 64 6c 25 28 31 29  2c 65 6e 64 78 25 28 31  |endl%(1),endx%(1|
000002e0  29 2c 77 69 6e 25 28 32  29 2c 74 68 25 28 31 29  |),win%(2),th%(1)|
000002f0  0d 03 fc 0b 41 25 3d b3  28 91 29 0d 04 06 0c e3  |....A%=.(.).....|
00000300  20 49 25 3d 30 b8 31 0d  04 10 0e 74 6f 74 25 28  | I%=0.1....tot%(|
00000310  49 25 29 3d 30 0d 04 1a  0c e3 20 4b 25 3d 30 b8  |I%)=0..... K%=0.|
00000320  39 0d 04 24 16 20 68 61  6e 64 24 28 49 25 2c 4b  |9..$. hand$(I%,K|
00000330  25 29 3d 22 20 20 22 0d  04 2e 07 ed 3a ed 0d 04  |%)="  ".....:...|
00000340  38 19 e3 20 49 25 3d 30  b8 32 3a 77 69 6e 25 28  |8.. I%=0.2:win%(|
00000350  49 25 29 3d 30 3a ed 0d  04 42 1b ef 32 33 2c 32  |I%)=0:...B..23,2|
00000360  35 35 2c 30 3b 30 3b 33  32 2c 31 31 32 2c 33 32  |55,0;0;32,112,32|
00000370  2c 30 0d 04 4c 1f ef 31  39 2c 31 2c 32 2c 30 2c  |,0..L..19,1,2,0,|
00000380  30 2c 30 3a ef 31 39 2c  32 2c 31 2c 30 2c 30 2c  |0,0:.19,2,1,0,0,|
00000390  30 0d 04 56 0f 62 6b 25  3d 30 3a 70 6b 25 3d 30  |0..V.bk%=0:pk%=0|
000003a0  0d 04 60 05 e1 0d 04 6a  05 3a 0d 04 74 0d dd f2  |..`....j.:..t...|
000003b0  73 68 75 66 66 6c 65 0d  04 7e 09 f7 8d 54 40 45  |shuffle..~...T@E|
000003c0  0d 04 88 0b ea 20 4e 25  2c 49 25 0d 04 92 0d e3  |..... N%,I%.....|
000003d0  20 4e 25 3d 30 b8 32 37  0d 04 9c 11 64 6f 6d 24  | N%=0.27....dom$|
000003e0  28 4e 25 29 3d 22 20 20  22 0d 04 a6 05 ed 0d 04  |(N%)="  ".......|
000003f0  b0 0d e3 20 4e 25 3d 30  b8 32 37 0d 04 ba 05 f5  |... N%=0.27.....|
00000400  0d 04 c4 0e 49 25 3d b3  28 32 38 29 2d 31 0d 04  |....I%=.(28)-1..|
00000410  ce 13 fd 20 64 6f 6d 24  28 49 25 29 3d 22 20 20  |... dom$(I%)="  |
00000420  22 0d 04 d8 0d f3 64 6f  6d 24 28 49 25 29 0d 04  |".....dom$(I%)..|
00000430  e2 05 ed 0d 04 ec 05 e1  0d 04 f6 05 3a 0d 05 00  |............:...|
00000440  55 dc 30 30 2c 30 31 2c  30 32 2c 30 33 2c 30 34  |U.00,01,02,03,04|
00000450  2c 30 35 2c 30 36 2c 31  31 2c 31 32 2c 31 33 2c  |,05,06,11,12,13,|
00000460  31 34 2c 31 35 2c 32 32  2c 32 33 2c 32 34 2c 32  |14,15,22,23,24,2|
00000470  35 2c 32 36 2c 33 33 2c  33 34 2c 33 35 2c 33 36  |5,26,33,34,35,36|
00000480  2c 34 34 2c 34 35 2c 34  36 2c 35 35 2c 35 36 2c  |,44,45,46,55,56,|
00000490  36 36 0d 05 0a 05 3a 0d  05 14 0b dd f2 73 74 61  |66....:......sta|
000004a0  72 74 0d 05 1e 1c ea 20  42 25 2c 62 64 25 2c 50  |rt..... B%,bd%,P|
000004b0  25 2c 4e 25 2c 70 64 25  2c 73 24 2c 74 24 0d 05  |%,N%,pd%,s$,t$..|
000004c0  28 05 db 0d 05 32 15 f1  8a 31 36 2c 31 29 22 44  |(....2...16,1)"D|
000004d0  4f 4d 49 4e 4f 45 53 22  0d 05 3c 39 f1 27 27 22  |OMINOES"..<9.''"|
000004e0  57 65 6c 63 6f 6d 65 20  74 6f 20 45 4c 4b 44 4f  |Welcome to ELKDO|
000004f0  4d 2e 22 27 27 22 50 6c  65 61 73 65 20 67 69 76  |M."''"Please giv|
00000500  65 20 6d 65 20 79 6f 75  72 20 6e 61 6d 65 3a 22  |e me your name:"|
00000510  27 0d 05 46 29 f5 3a e8  8a 30 2c 38 29 6e 24 3a  |'..F).:..0,8)n$:|
00000520  4c 25 3d a9 28 6e 24 29  3a e7 20 4c 25 3e 31 30  |L%=.(n$):. L%>10|
00000530  20 f1 8a 30 2c 38 29 89  4c 25 0d 05 50 0b fd 20  | ..0,8).L%..P.. |
00000540  4c 25 3c 31 31 0d 05 5a  16 f1 27 27 22 48 65 6c  |L%<11..Z..''"Hel|
00000550  6c 6f 20 22 3b 6e 24 3b  22 2e 22 0d 05 64 7b f1  |lo ";n$;"."..d{.|
00000560  22 50 6c 65 61 73 65 20  65 6e 74 65 72 20 61 20  |"Please enter a |
00000570  6e 75 6d 62 65 72 20 28  31 2d 32 38 29 20 74 6f  |number (1-28) to|
00000580  20 73 65 6c 65 63 74 22  27 27 22 61 20 64 6f 6d  | select"''"a dom|
00000590  69 6e 6f 2c 20 74 68 65  20 45 4c 4b 20 77 69 6c  |ino, the ELK wil|
000005a0  6c 20 61 6c 73 6f 20 63  68 6f 6f 73 65 20 2d 22  |l also choose -"|
000005b0  27 27 22 74 68 65 20 68  69 67 68 65 73 74 20 6e  |''"the highest n|
000005c0  75 6d 62 65 72 20 6f 66  20 64 6f 74 73 20 73 74  |umber of dots st|
000005d0  61 72 74 73 21 22 0d 05  6e 27 f5 3a e8 8a 30 2c  |arts!"..n'.:..0,|
000005e0  31 39 29 50 25 3a 50 25  3d 50 25 2d 31 3a fd 20  |19)P%:P%=P%-1:. |
000005f0  50 25 3c 32 38 20 80 20  50 25 3e 3d 30 0d 05 78  |P%<28 . P%>=0..x|
00000600  13 70 64 25 3d a4 74 6f  74 64 6f 74 28 50 25 29  |.pd%=.totdot(P%)|
00000610  0d 05 82 05 f5 0d 05 8c  0e 42 25 3d b3 28 32 38  |.........B%=.(28|
00000620  29 2d 31 0d 05 96 1c 62  64 25 3d a4 74 6f 74 64  |)-1....bd%=.totd|
00000630  6f 74 28 42 25 29 3a 73  24 3d 22 45 4c 4b 22 0d  |ot(B%):s$="ELK".|
00000640  05 a0 17 fd 20 43 25 3c  3e 42 25 20 80 20 70 64  |.... C%<>B% . pd|
00000650  25 3c 3e 62 64 25 0d 05  aa 6e 20 f2 64 6f 6d 69  |%<>bd%...n .domi|
00000660  6e 6f 28 33 32 30 2c 33  32 30 2c b9 2c a4 6c 64  |no(320,320,.,.ld|
00000670  6f 74 28 64 6f 6d 24 28  50 25 29 29 2c a4 72 64  |ot(dom$(P%)),.rd|
00000680  6f 74 28 64 6f 6d 24 28  42 25 29 29 29 3a f2 64  |ot(dom$(B%))):.d|
00000690  6f 6d 69 6e 6f 28 39 36  30 2c 33 32 30 2c b9 2c  |omino(960,320,.,|
000006a0  a4 6c 64 6f 74 28 64 6f  6d 24 28 42 25 29 29 2c  |.ldot(dom$(B%)),|
000006b0  a4 72 64 6f 74 28 64 6f  6d 24 28 42 25 29 29 29  |.rdot(dom$(B%)))|
000006c0  20 20 20 20 0d 05 b4 2c  f1 8a 30 2c 32 36 29 89  |    ...,..0,26).|
000006d0  28 31 30 2d a9 28 6e 24  29 81 32 29 3b 6e 24 3b  |(10-.(n$).2);n$;|
000006e0  89 28 31 37 2d a9 28 6e  24 29 81 32 29 3b 73 24  |.(17-.(n$).2);s$|
000006f0  0d 05 be 23 e7 20 62 64  25 3e 70 64 25 20 45 4c  |...#. bd%>pd% EL|
00000700  4b 25 3d b9 20 8b 20 45  4c 4b 25 3d a3 3a 73 24  |K%=. . ELK%=.:s$|
00000710  3d 6e 24 0d 05 c8 31 f1  27 73 24 3b 22 20 73 74  |=n$...1.'s$;" st|
00000720  61 72 74 73 21 22 27 27  22 50 72 65 73 73 20 61  |arts!"''"Press a|
00000730  6e 79 20 6b 65 79 20 74  6f 20 63 6f 6e 74 69 6e  |ny key to contin|
00000740  75 65 2e 22 0d 05 d2 08  50 25 3d a5 0d 05 dc 05  |ue."....P%=.....|
00000750  e1 0d 05 f0 30 dd a4 74  6f 74 64 6f 74 28 4e 25  |....0..totdot(N%|
00000760  29 3d a4 6c 64 6f 74 28  64 6f 6d 24 28 4e 25 29  |)=.ldot(dom$(N%)|
00000770  29 2b a4 72 64 6f 74 28  64 6f 6d 24 28 4e 25 29  |)+.rdot(dom$(N%)|
00000780  29 0d 05 fa 05 3a 0d 06  04 18 dd a4 6c 64 6f 74  |)....:......ldot|
00000790  28 44 24 29 3d bb 28 c0  44 24 2c 31 29 29 0d 06  |(D$)=.(.D$,1))..|
000007a0  0e 05 3a 0d 06 18 19 dd  a4 72 64 6f 74 28 44 24  |..:......rdot(D$|
000007b0  29 3d bb 28 c2 44 24 2c  31 29 29 20 0d 06 22 05  |)=.(.D$,1)) ..".|
000007c0  3a 0d 06 2c 1c dd f2 64  6f 6d 69 6e 6f 28 58 25  |:..,...domino(X%|
000007d0  2c 59 25 2c 4f 25 2c 4c  25 2c 52 25 29 0d 06 36  |,Y%,O%,L%,R%)..6|
000007e0  0b ea 20 4e 25 2c 44 25  0d 06 40 60 e6 30 2c 32  |.. N%,D%..@`.0,2|
000007f0  3a e7 20 4f 25 20 ec 58  25 2d 33 30 2c 59 25 2d  |:. O% .X%-30,Y%-|
00000800  36 3a f0 30 2c 30 2c 31  32 3a f0 20 38 31 2c 36  |6:.0,0,12:. 81,6|
00000810  30 2c 2d 31 32 3a f0 38  31 2c 30 2c 31 32 20 8b  |0,-12:.81,0,12 .|
00000820  20 ec 58 25 2d 36 2c 59  25 2d 33 30 3a f0 30 2c  | .X%-6,Y%-30:.0,|
00000830  31 32 2c 30 3a f0 38 31  2c 2d 31 32 2c 36 30 3a  |12,0:.81,-12,60:|
00000840  f0 38 31 2c 31 32 2c 30  0d 06 4a 13 e3 20 4e 25  |.81,12,0..J.. N%|
00000850  3d 2d 31 20 b8 20 31 20  88 20 32 0d 06 54 36 e6  |=-1 . 1 . 2..T6.|
00000860  30 2c 33 3a e7 20 4f 25  20 ec 58 25 2b 4e 25 2a  |0,3:. O% .X%+N%*|
00000870  33 30 2c 59 25 2b 4e 25  2a 36 36 20 8b 20 ec 20  |30,Y%+N%*66 . . |
00000880  58 25 2b 4e 25 2a 36 36  2c 59 25 2b 4e 25 2a 33  |X%+N%*66,Y%+N%*3|
00000890  30 0d 06 5e 2d f0 30 2c  2d 36 30 2a 4e 25 2c 30  |0..^-.0,-60*N%,0|
000008a0  3a f0 38 31 2c 36 30 2a  4e 25 2c 2d 36 30 2a 4e  |:.81,60*N%,-60*N|
000008b0  25 3a f0 38 31 2c 2d 36  30 2a 4e 25 2c 30 0d 06  |%:.81,-60*N%,0..|
000008c0  68 05 ed 0d 06 72 0c 4f  25 3d 94 28 4f 25 29 0d  |h....r.O%=.(O%).|
000008d0  06 7c 14 e3 20 4e 25 3d  2d 31 20 b8 20 31 20 88  |.|.. N%=-1 . 1 .|
000008e0  20 32 20 0d 06 86 26 48  25 3d 4f 25 2a 28 58 25  | 2 ...&H%=O%*(X%|
000008f0  2d 38 29 2d 28 4f 25 2d  31 29 2a 28 28 58 25 2d  |-8)-(O%-1)*((X%-|
00000900  38 29 2b 4e 25 2a 33 36  29 0d 06 90 29 56 25 3d  |8)+N%*36)...)V%=|
00000910  4f 25 2a 28 28 59 25 2b  31 38 29 2b 4e 25 2a 33  |O%*((Y%+18)+N%*3|
00000920  36 29 2d 28 4f 25 2d 31  29 2a 28 59 25 2b 31 38  |6)-(O%-1)*(Y%+18|
00000930  29 20 0d 06 9a 19 e7 20  4e 25 3d 2d 31 20 44 25  |) ..... N%=-1 D%|
00000940  3d 4c 25 20 8b 20 44 25  3d 52 25 0d 06 a4 15 ef  |=L% . D%=R%.....|
00000950  35 3a f2 64 6f 74 28 48  25 2c 56 25 2c 44 25 29  |5:.dot(H%,V%,D%)|
00000960  0d 06 ae 05 ed 0d 06 b8  06 ef 34 0d 06 c2 05 e1  |..........4.....|
00000970  0d 06 cc 05 3a 0d 06 d6  13 dd f2 64 6f 74 28 58  |....:......dot(X|
00000980  25 2c 59 25 2c 54 25 29  0d 06 e0 17 ea 20 4e 25  |%,Y%,T%)..... N%|
00000990  2c 4d 25 2c 44 25 2c 41  25 2c 48 25 2c 56 25 0d  |,M%,D%,A%,H%,V%.|
000009a0  06 ea 13 4d 25 3d 54 25  83 32 3a 44 25 3d 54 25  |...M%=T%.2:D%=T%|
000009b0  81 32 0d 06 f4 0f e6 34  2c 30 3a ec 58 25 2c 59  |.2.....4,0:.X%,Y|
000009c0  25 0d 06 fe 10 e7 20 4d  25 20 f1 20 bd 32 35 35  |%..... M% . .255|
000009d0  3b 0d 07 08 0c e7 20 44  25 3d 30 20 e1 0d 07 12  |;..... D%=0 ....|
000009e0  16 e7 20 4f 25 20 f7 8d  74 54 47 20 8b 20 f7 8d  |.. O% ..tTG . ..|
000009f0  74 5e 47 0d 07 1c 08 4e  25 3d 30 0d 07 26 05 f5  |t^G....N%=0..&..|
00000a00  0d 07 30 0f f3 41 25 3a  4e 25 3d 4e 25 2b 31 0d  |..0..A%:N%=N%+1.|
00000a10  07 3a 0b fd 20 4e 25 3d  44 25 0d 07 44 09 f7 8d  |.:.. N%=D%..D...|
00000a20  74 68 47 0d 07 4e 0c e3  20 4e 25 3d 31 b8 38 0d  |thG..N.. N%=1.8.|
00000a30  07 58 0d f3 48 25 2c 56  25 2c 51 25 0d 07 62 13  |.X..H%,V%,Q%..b.|
00000a40  ec 58 25 2c 59 25 3a f0  30 2c 48 25 2c 56 25 0d  |.X%,Y%:.0,H%,V%.|
00000a50  07 6c 14 e7 20 51 25 20  80 20 41 25 20 f1 20 bd  |.l.. Q% . A% . .|
00000a60  32 35 35 0d 07 76 06 ed  20 0d 07 80 05 e1 0d 07  |255..v.. .......|
00000a70  8a 05 3a 0d 07 94 10 dc  26 34 34 2c 26 35 35 2c  |..:.....&44,&55,|
00000a80  26 44 44 0d 07 9e 12 dc  26 31 31 2c 26 35 35 2c  |&DD.....&11,&55,|
00000a90  26 37 37 20 20 0d 07 a8  4e dc 2d 32 30 2c 32 30  |&77  ...N.-20,20|
00000aa0  2c 31 2c 30 2c 32 30 2c  32 2c 32 30 2c 32 30 2c  |,1,0,20,2,20,20,|
00000ab0  34 2c 32 30 2c 30 2c 38  2c 32 30 2c 2d 32 30 2c  |4,20,0,8,20,-20,|
00000ac0  26 31 30 2c 30 2c 2d 32  30 2c 26 32 30 2c 2d 32  |&10,0,-20,&20,-2|
00000ad0  30 2c 2d 32 30 2c 26 34  30 2c 2d 32 30 2c 30 2c  |0,-20,&40,-20,0,|
00000ae0  26 38 30 0d 07 b2 05 3a  0d 07 bc 11 dd f2 70 69  |&80....:......pi|
00000af0  63 6b 28 50 25 2c 44 25  29 0d 07 c6 08 ea 20 4e  |ck(P%,D%)..... N|
00000b00  25 0d 07 d0 0f e3 20 4e  25 3d 31 20 b8 20 44 25  |%..... N%=1 . D%|
00000b10  0d 07 da 3e e7 20 53 25  3e 32 37 20 44 25 3d 4e  |...>. S%>27 D%=N|
00000b20  25 20 8b 20 68 61 6e 64  24 28 50 25 2c 74 6f 74  |% . hand$(P%,tot|
00000b30  25 28 50 25 29 29 3d 64  6f 6d 24 28 53 25 29 3a  |%(P%))=dom$(S%):|
00000b40  53 25 3d 53 25 2b 31 3a  f2 73 6f 75 6e 64 0d 07  |S%=S%+1:.sound..|
00000b50  e4 05 ed 0d 07 ee 05 e1  0d 07 f8 05 3a 0d 08 02  |............:...|
00000b60  15 dd f2 64 69 73 70 68  61 6e 64 28 50 25 2c 54  |...disphand(P%,T|
00000b70  25 29 0d 08 0c 27 ef 32  34 2c 35 30 30 3b 30 2b  |%)...'.24,500;0+|
00000b80  54 25 2a 31 38 34 3b 31  32 37 39 3b 31 38 34 2b  |T%*184;1279;184+|
00000b90  54 25 2a 31 38 34 3b 31  36 0d 08 16 0b ea 20 4e  |T%*184;16..... N|
00000ba0  25 2c 58 25 0d 08 20 16  e7 20 74 6f 74 25 28 50  |%,X%.. .. tot%(P|
00000bb0  25 29 3d 30 20 ef 32 36  3a e1 0d 08 2a 17 e3 20  |%)=0 .26:...*.. |
00000bc0  4e 25 3d 30 20 b8 20 74  6f 74 25 28 50 25 29 2d  |N%=0 . tot%(P%)-|
00000bd0  31 0d 08 34 12 58 25 3d  35 33 32 2b 28 4e 25 29  |1..4.X%=532+(N%)|
00000be0  2a 37 32 0d 08 3e 43 f2  64 6f 6d 69 6e 6f 28 58  |*72..>C.domino(X|
00000bf0  25 2c 38 30 2b 54 25 2a  31 38 34 2c b9 2c a4 6c  |%,80+T%*184,.,.l|
00000c00  64 6f 74 28 68 61 6e 64  24 28 50 25 2c 4e 25 29  |dot(hand$(P%,N%)|
00000c10  29 2c a4 72 64 6f 74 28  68 61 6e 64 24 28 50 25  |),.rdot(hand$(P%|
00000c20  2c 4e 25 29 29 29 0d 08  48 15 ec 58 25 2d 31 30  |,N%)))..H..X%-10|
00000c30  2c 31 38 30 2b 54 25 2a  31 38 34 0d 08 52 06 ef  |,180+T%*184..R..|
00000c40  35 0d 08 5c 0f e7 20 54  25 3d 30 20 f1 3b 4e 25  |5..\.. T%=0 .;N%|
00000c50  0d 08 66 2c ed 3a e7 20  54 25 3d 30 20 ef 34 2c  |..f,.:. T%=0 .4,|
00000c60  32 34 2c 30 3b 31 39 36  3b 31 32 37 39 3b 31 30  |24,0;196;1279;10|
00000c70  32 33 3b 20 8b 20 ef 34  2c 32 36 20 0d 08 70 05  |23; . .4,26 ..p.|
00000c80  e1 0d 08 7a 05 3a 0d 08  84 09 dd f2 45 4c 4b 0d  |...z.:......ELK.|
00000c90  08 8e 27 ea 20 45 25 2c  4e 25 2c 44 25 2c 4f 25  |..'. E%,N%,D%,O%|
00000ca0  2c 4c 25 2c 52 25 2c 50  25 3a 45 4c 4b 25 3d a3  |,L%,R%,P%:ELK%=.|
00000cb0  3a 62 6b 25 3d 30 0d 08  98 b8 e7 20 65 6e 64 25  |:bk%=0..... end%|
00000cc0  28 30 29 3d 2d 31 20 58  25 3d 36 34 30 3a 59 25  |(0)=-1 X%=640:Y%|
00000cd0  3d 36 32 33 3a 44 25 3d  a4 31 73 74 3a 4c 25 3d  |=623:D%=.1st:L%=|
00000ce0  a4 6c 64 6f 74 28 68 61  6e 64 24 28 30 2c 44 25  |.ldot(hand$(0,D%|
00000cf0  29 29 3a 52 25 3d a4 72  64 6f 74 28 68 61 6e 64  |)):R%=.rdot(hand|
00000d00  24 28 30 2c 44 25 29 29  3a 65 6e 64 25 28 30 29  |$(0,D%)):end%(0)|
00000d10  3d 4c 25 3a 65 6e 64 25  28 31 29 3d 52 25 3a 4f  |=L%:end%(1)=R%:O|
00000d20  25 3d 28 4c 25 3d 52 25  29 3a 50 25 3d 31 3a e3  |%=(L%=R%):P%=1:.|
00000d30  20 45 25 3d 30 b8 31 3a  65 6e 64 78 25 28 45 25  | E%=0.1:endx%(E%|
00000d40  29 3d 36 34 30 2b a4 63  65 6e 74 72 65 3a f2 65  |)=640+.centre:.e|
00000d50  6e 64 6e 6f 28 45 25 29  3a ed 20 8b 20 f2 70 6c  |ndno(E%):. . .pl|
00000d60  61 79 3a f2 65 6e 64 6e  6f 28 45 25 29 20 0d 08  |ay:.endno(E%) ..|
00000d70  a2 3f e7 20 50 25 20 f2  64 6f 6d 69 6e 6f 28 58  |.?. P% .domino(X|
00000d80  25 2c 59 25 2c 4f 25 2c  4c 25 2c 52 25 29 3a f2  |%,Y%,O%,L%,R%):.|
00000d90  73 6f 72 74 28 30 2c 44  25 29 20 8b 20 f2 70 69  |sort(0,D%) . .pi|
00000da0  63 6b 28 30 2c 31 29 3a  62 6b 25 3d 31 0d 08 ac  |ck(0,1):bk%=1...|
00000db0  05 e1 0d 08 b6 05 3a 0d  08 c0 0e dd a4 76 65 72  |......:......ver|
00000dc0  74 28 44 24 29 0d 08 ca  20 e7 20 a4 6c 64 6f 74  |t(D$)... . .ldot|
00000dd0  28 44 24 29 3d a4 72 64  6f 74 28 44 24 29 3d b9  |(D$)=.rdot(D$)=.|
00000de0  20 8b 20 3d a3 0d 08 d4  05 3a 0d 08 de 0c dd f2  | . =.....:......|
00000df0  70 6c 61 79 65 72 0d 08  e8 36 ea 20 45 25 2c 42  |player...6. E%,B|
00000e00  25 2c 46 25 2c 4e 25 2c  44 25 2c 58 25 2c 59 25  |%,F%,N%,D%,X%,Y%|
00000e10  2c 4f 25 2c 49 25 2c 4a  25 2c 4c 25 2c 52 25 3a  |,O%,I%,J%,L%,R%:|
00000e20  45 4c 4b 25 3d b9 3a 70  6b 25 3d 30 0d 08 f2 40  |ELK%=.:pk%=0...@|
00000e30  f1 27 22 50 72 65 73 73  20 6e 75 6d 62 65 72 22  |.'"Press number"|
00000e40  27 22 66 6f 72 20 64 6f  6d 69 6e 6f 22 27 22 79  |'"for domino"'"y|
00000e50  6f 75 20 77 69 73 68 20  74 6f 22 27 22 70 6c 61  |ou wish to"'"pla|
00000e60  79 2e 28 6b 3d 4b 6e 6f  63 6b 29 22 0d 08 fc 51  |y.(k=Knock)"...Q|
00000e70  f5 3a 44 25 3d a5 2d 34  38 3a fd 28 44 25 3e 3d  |.:D%=.-48:.(D%>=|
00000e80  30 20 80 20 44 25 3c 74  6f 74 25 28 31 29 29 84  |0 . D%<tot%(1)).|
00000e90  20 44 25 3d 35 39 20 84  20 44 25 3d 32 37 3a e7  | D%=59 . D%=27:.|
00000ea0  20 44 25 3e 74 6f 74 25  28 31 29 f2 70 69 63 6b  | D%>tot%(1).pick|
00000eb0  28 31 2c 31 29 3a 70 6b  25 3d 31 3a e1 0d 09 06  |(1,1):pk%=1:....|
00000ec0  45 49 25 3d a4 6c 64 6f  74 28 68 61 6e 64 24 28  |EI%=.ldot(hand$(|
00000ed0  31 2c 44 25 29 29 3a 4a  25 3d a4 72 64 6f 74 28  |1,D%)):J%=.rdot(|
00000ee0  68 61 6e 64 24 28 31 2c  44 25 29 29 3a 4f 25 3d  |hand$(1,D%)):O%=|
00000ef0  a4 76 65 72 74 28 68 61  6e 64 24 28 31 2c 44 25  |.vert(hand$(1,D%|
00000f00  29 29 0d 09 10 77 e7 20  65 6e 64 25 28 30 29 3d  |))...w. end%(0)=|
00000f10  2d 31 20 58 25 3d 36 34  30 3a 59 25 3d 36 32 33  |-1 X%=640:Y%=623|
00000f20  3a 4c 25 3d 49 25 3a 52  25 3d 4a 25 3a 65 6e 64  |:L%=I%:R%=J%:end|
00000f30  25 28 30 29 3d 4c 25 3a  65 6e 64 25 28 31 29 3d  |%(0)=L%:end%(1)=|
00000f40  52 25 3a 50 25 3d b9 3a  e3 20 45 25 3d 30 b8 31  |R%:P%=.:. E%=0.1|
00000f50  3a 65 6e 64 78 25 28 45  25 29 3d 36 34 30 2b a4  |:endx%(E%)=640+.|
00000f60  63 65 6e 74 72 65 3a f2  65 6e 64 6e 6f 28 45 25  |centre:.endno(E%|
00000f70  29 3a ed 3a e5 8d 44 42  49 0d 09 1a 5d e7 20 65  |):.:..DBI...]. e|
00000f80  6e 64 25 28 30 29 3c 3e  2d 31 20 db 3a f1 27 22  |nd%(0)<>-1 .:.'"|
00000f90  50 72 65 73 73 20 6e 75  6d 62 65 72 22 27 22 66  |Press number"'"f|
00000fa0  6f 72 20 65 6e 64 22 27  22 79 6f 75 20 77 69 73  |or end"'"you wis|
00000fb0  68 20 74 6f 22 27 22 70  6c 61 79 2e 22 3a f5 3a  |h to"'"play.":.:|
00000fc0  45 25 3d a5 2d 34 39 3a  fd 20 45 25 3d 30 20 84  |E%=.-49:. E%=0 .|
00000fd0  20 45 25 3d 31 20 0d 09  24 1b e7 20 49 25 3d 65  | E%=1 ..$.. I%=e|
00000fe0  6e 64 25 28 45 25 29 20  42 25 3d 30 3a 46 25 3d  |nd%(E%) B%=0:F%=|
00000ff0  31 0d 09 2e 1b e7 20 4a  25 3d 65 6e 64 25 28 45  |1..... J%=end%(E|
00001000  25 29 20 42 25 3d 31 3a  46 25 3d 31 0d 09 38 36  |%) B%=1:F%=1..86|
00001010  e7 20 46 25 20 f2 65 6e  64 6e 6f 28 45 25 29 3a  |. F% .endno(E%):|
00001020  f2 61 72 72 61 6e 67 65  28 42 25 29 3a f2 73 65  |.arrange(B%):.se|
00001030  74 75 70 28 45 25 29 3a  f2 65 6e 64 6e 6f 28 45  |tup(E%):.endno(E|
00001040  25 29 0d 09 42 3f e7 20  50 25 20 f2 64 6f 6d 69  |%)..B?. P% .domi|
00001050  6e 6f 28 58 25 2c 59 25  2c 4f 25 2c 4c 25 2c 52  |no(X%,Y%,O%,L%,R|
00001060  25 29 3a f2 73 6f 72 74  28 31 2c 44 25 29 20 8b  |%):.sort(1,D%) .|
00001070  20 f2 70 69 63 6b 28 31  2c 31 29 3a 70 6b 25 3d  | .pick(1,1):pk%=|
00001080  31 0d 09 4c 15 e7 20 57  54 20 d4 30 2c 2d 31 35  |1..L.. WT .0,-15|
00001090  2c 31 30 30 2c 36 0d 09  56 11 e7 20 57 54 20 47  |,100,6..V.. WT G|
000010a0  3d a6 28 31 30 30 29 0d  09 60 05 e1 0d 09 6a 05  |=.(100)..`....j.|
000010b0  3a 0d 09 74 0a dd f2 70  6c 61 79 0d 09 7e 23 ea  |:..t...play..~#.|
000010c0  20 49 25 2c 69 25 2c 4a  25 2c 6a 25 2c 4b 25 2c  | I%,i%,J%,j%,K%,|
000010d0  42 25 2c 54 25 2c 4d 25  3a 45 25 3d 2d 31 0d 09  |B%,T%,M%:E%=-1..|
000010e0  88 15 e3 20 4d 25 3d 30  b8 20 74 6f 74 25 28 30  |... M%=0. tot%(0|
000010f0  29 2d 31 0d 09 92 2f 69  25 3d a4 6c 64 6f 74 28  |)-1.../i%=.ldot(|
00001100  68 61 6e 64 24 28 30 2c  4d 25 29 29 3a 6a 25 3d  |hand$(0,M%)):j%=|
00001110  a4 72 64 6f 74 28 68 61  6e 64 24 28 30 2c 4d 25  |.rdot(hand$(0,M%|
00001120  29 29 0d 09 9c 0e e3 20  4b 25 3d 30 20 b8 20 31  |))..... K%=0 . 1|
00001130  0d 09 a6 28 e7 20 69 25  3d 65 6e 64 25 28 4b 25  |...(. i%=end%(K%|
00001140  29 20 80 20 54 25 3c 3d  69 25 2b 6a 25 20 f2 73  |) . T%<=i%+j% .s|
00001150  61 76 65 3a 42 25 3d 30  0d 09 b0 28 e7 20 6a 25  |ave:B%=0...(. j%|
00001160  3d 65 6e 64 25 28 4b 25  29 20 80 20 54 25 3c 3d  |=end%(K%) . T%<=|
00001170  69 25 2b 6a 25 20 f2 73  61 76 65 3a 42 25 3d 31  |i%+j% .save:B%=1|
00001180  0d 09 ba 07 ed 3a ed 0d  09 c4 19 4f 25 3d a4 76  |.....:.....O%=.v|
00001190  65 72 74 28 68 61 6e 64  24 28 30 2c 44 25 29 29  |ert(hand$(0,D%))|
000011a0  0d 09 ce 2e e7 20 45 25  3e 2d 31 20 f2 65 6e 64  |..... E%>-1 .end|
000011b0  6e 6f 28 45 25 29 3a f2  61 72 72 61 6e 67 65 28  |no(E%):.arrange(|
000011c0  42 25 29 3a f2 73 65 74  75 70 28 45 25 29 0d 09  |B%):.setup(E%)..|
000011d0  d8 05 e1 0d 09 e2 05 3a  0d 09 ec 2d dd f2 73 61  |.......:...-..sa|
000011e0  76 65 3a 44 25 3d 4d 25  3a 54 25 3d 69 25 2b 6a  |ve:D%=M%:T%=i%+j|
000011f0  25 3a 49 25 3d 69 25 3a  4a 25 3d 6a 25 3a 45 25  |%:I%=i%:J%=j%:E%|
00001200  3d 4b 25 3a e1 0d 09 f6  05 3a 0d 0a 00 0f dd f2  |=K%:.....:......|
00001210  73 65 74 75 70 28 45 25  29 0d 0a 0a 0b ea 20 43  |setup(E%)..... C|
00001220  25 2c 57 25 0d 0a 14 3d  50 25 3d 31 3a 43 25 3d  |%,W%...=P%=1:C%=|
00001230  a4 63 65 6e 74 72 65 3a  58 25 3d 65 6e 64 78 25  |.centre:X%=endx%|
00001240  28 45 25 29 2b 43 25 3a  57 25 3d 65 6e 64 78 25  |(E%)+C%:W%=endx%|
00001250  28 45 25 29 2b 32 2a 43  25 2b 38 2a b4 28 43 25  |(E%)+2*C%+8*.(C%|
00001260  29 0d 0a 1e 72 e7 20 57  25 3c 37 20 84 20 57 25  |)...r. W%<7 . W%|
00001270  3e 31 32 37 31 20 65 6e  64 6c 25 28 45 25 29 3d  |>1271 endl%(E%)=|
00001280  65 6e 64 6c 25 28 45 25  29 2b b4 28 43 25 29 3a  |endl%(E%)+.(C%):|
00001290  58 25 3d 43 25 2d 31 32  37 39 2a 28 45 25 3d 30  |X%=C%-1279*(E%=0|
000012a0  29 3a 65 6e 64 78 25 28  45 25 29 3d 57 25 2d 65  |):endx%(E%)=W%-e|
000012b0  6e 64 78 25 28 45 25 29  2d 31 32 37 39 2a 28 45  |ndx%(E%)-1279*(E|
000012c0  25 3d 30 29 20 8b 20 65  6e 64 78 25 28 45 25 29  |%=0) . endx%(E%)|
000012d0  3d 57 25 0d 0a 28 19 59  25 3d 31 31 30 33 2d 65  |=W%..(.Y%=1103-e|
000012e0  6e 64 6c 25 28 45 25 29  2a 31 36 30 0d 0a 32 05  |ndl%(E%)*160..2.|
000012f0  e1 0d 0a 3c 05 3a 0d 0a  46 35 dd a4 63 65 6e 74  |...<.:..F5..cent|
00001300  72 65 3d 2d 28 28 4f 25  3d 30 29 2a 37 30 2b 28  |re=-((O%=0)*70+(|
00001310  4f 25 3d b9 29 2a 33 34  29 2a 28 28 45 25 3d 30  |O%=.)*34)*((E%=0|
00001320  29 2d 28 45 25 3d 31 29  29 20 20 0d 0a 50 05 3a  |)-(E%=1))  ..P.:|
00001330  0d 0a 5a 11 dd f2 73 6f  72 74 28 50 25 2c 44 25  |..Z...sort(P%,D%|
00001340  29 0d 0a 64 0b ea 20 4e  25 2c 54 25 0d 0a 6e 36  |)..d.. N%,T%..n6|
00001350  e7 20 74 6f 74 25 28 50  25 29 3c 31 30 20 54 25  |. tot%(P%)<10 T%|
00001360  3d 74 6f 74 25 28 50 25  29 2d 31 20 8b 20 54 25  |=tot%(P%)-1 . T%|
00001370  3d 38 3a 68 61 6e 64 24  28 50 25 2c 39 29 22 20  |=8:hand$(P%,9)" |
00001380  20 22 0d 0a 78 10 e3 20  4e 25 3d 44 25 b8 20 54  | "..x.. N%=D%. T|
00001390  25 20 0d 0a 82 1f 68 61  6e 64 24 28 50 25 2c 4e  |% ....hand$(P%,N|
000013a0  25 29 3d 68 61 6e 64 24  28 50 25 2c 4e 25 2b 31  |%)=hand$(P%,N%+1|
000013b0  29 0d 0a 8c 05 ed 0d 0a  96 17 74 6f 74 25 28 50  |).........tot%(P|
000013c0  25 29 3d 74 6f 74 25 28  50 25 29 2d 31 0d 0a a0  |%)=tot%(P%)-1...|
000013d0  05 e1 0d 0a aa 05 3a 0d  0a b4 11 dd f2 61 72 72  |......:......arr|
000013e0  61 6e 67 65 28 46 25 29  0d 0a be 24 e7 20 46 25  |ange(F%)...$. F%|
000013f0  3d 30 20 65 6e 64 25 28  45 25 29 3d 4a 25 20 8b  |=0 end%(E%)=J% .|
00001400  20 65 6e 64 25 28 45 25  29 3d 49 25 0d 0a c8 25  | end%(E%)=I%...%|
00001410  e7 20 46 25 3d 45 25 20  52 25 3d 49 25 3a 4c 25  |. F%=E% R%=I%:L%|
00001420  3d 4a 25 20 8b 20 4c 25  3d 49 25 3a 52 25 3d 4a  |=J% . L%=I%:R%=J|
00001430  25 0d 0a d2 05 e1 0d 0a  dc 05 3a 0d 0a e6 09 dd  |%.........:.....|
00001440  a4 31 73 74 0d 0a f0 11  ea 20 4e 25 2c 54 25 2c  |.1st..... N%,T%,|
00001450  48 25 2c 49 25 0d 0a fa  0c e3 20 4e 25 3d 31 b8  |H%,I%..... N%=1.|
00001460  37 0d 0b 04 2a 54 25 3d  a4 74 6f 74 64 6f 74 28  |7...*T%=.totdot(|
00001470  4e 25 2d 31 29 3a e7 20  54 25 3e 48 25 20 48 25  |N%-1):. T%>H% H%|
00001480  3d 54 25 3a 49 25 3d 4e  25 2d 31 0d 0b 0e 09 ed  |=T%:I%=N%-1.....|
00001490  3a 3d 49 25 0d 0b 18 05  3a 0d 0b 22 0f dd f2 65  |:=I%....:.."...e|
000014a0  6e 64 6e 6f 28 45 25 29  0d 0b 2c 49 e7 20 45 25  |ndno(E%)..,I. E%|
000014b0  3d 2d 31 20 e1 20 8b 20  ef 35 3a e6 34 2c 30 3a  |=-1 . . .5:.4,0:|
000014c0  ec 65 6e 64 78 25 28 45  25 29 2b 33 30 2a 28 45  |.endx%(E%)+30*(E|
000014d0  25 3d 30 29 2c 31 31 31  35 2d 65 6e 64 6c 25 28  |%=0),1115-endl%(|
000014e0  45 25 29 2a 31 36 30 3a  f1 3b 45 25 2b 31 3a ef  |E%)*160:.;E%+1:.|
000014f0  34 0d 0b 36 05 e1 0d 0b  40 05 3a 0d 0b 4a 09 dd  |4..6....@.:..J..|
00001500  a4 77 69 6e 0d 0b 54 0b  ea 20 4e 25 2c 49 25 0d  |.win..T.. N%,I%.|
00001510  0b 5e 0c e3 20 4e 25 3d  30 b8 31 0d 0b 68 0d 74  |.^.. N%=0.1..h.t|
00001520  68 25 28 4e 25 29 3d 30  0d 0b 72 16 e3 20 49 25  |h%(N%)=0..r.. I%|
00001530  3d 30 b8 20 74 6f 74 25  28 4e 25 29 2d 31 0d 0b  |=0. tot%(N%)-1..|
00001540  7c 3b 74 68 25 28 4e 25  29 3d 74 68 25 28 4e 25  ||;th%(N%)=th%(N%|
00001550  29 2b a4 6c 64 6f 74 28  68 61 6e 64 24 28 4e 25  |)+.ldot(hand$(N%|
00001560  2c 49 25 29 29 2b a4 72  64 6f 74 28 68 61 6e 64  |,I%))+.rdot(hand|
00001570  24 28 4e 25 2c 49 25 29  29 0d 0b 86 07 ed 3a ed  |$(N%,I%)).....:.|
00001580  0d 0b 90 16 e7 20 74 68  25 28 30 29 3e 74 68 25  |..... th%(0)>th%|
00001590  28 31 29 20 3d 31 0d 0b  9a 1b e7 20 74 68 25 28  |(1) =1..... th%(|
000015a0  31 29 3e 74 68 25 28 30  29 20 3d 30 20 8b 20 3d  |1)>th%(0) =0 . =|
000015b0  32 0d 0b a4 05 3a 0d 0b  ae 0d dd f2 77 69 6e 28  |2....:......win(|
000015c0  57 25 29 0d 0b b8 0a ef  32 36 2c 31 32 0d 0b c2  |W%).....26,12...|
000015d0  08 ea 20 4e 25 0d 0b cc  1b e7 20 57 25 3d 30 3a  |.. N%..... W%=0:|
000015e0  45 4c 4b 25 3d b9 3a 57  24 3d 22 45 4c 4b 22 20  |ELK%=.:W$="ELK" |
000015f0  0d 0b d6 17 e7 20 57 25  3d 31 3a 45 4c 4b 25 3d  |..... W%=1:ELK%=|
00001600  a3 3a 57 24 3d 6e 24 0d  0b e0 32 e7 20 57 25 3c  |.:W$=n$...2. W%<|
00001610  32 20 f1 27 22 54 68 65  20 57 49 4e 4e 45 52 20  |2 .'"The WINNER |
00001620  69 73 20 22 3b 57 24 20  8b 20 f1 27 22 47 61 6d  |is ";W$ . .'"Gam|
00001630  65 20 44 72 61 77 6e 21  22 0d 0b ea 17 f1 27 27  |e Drawn!".....''|
00001640  22 53 74 61 74 65 20 6f  66 20 70 6c 61 79 3a 22  |"State of play:"|
00001650  0d 0b f4 17 77 69 6e 25  28 57 25 29 3d 77 69 6e  |....win%(W%)=win|
00001660  25 28 57 25 29 2b 31 0d  0b fe 47 f1 27 27 89 28  |%(W%)+1...G.''.(|
00001670  36 29 3b 22 45 4c 4b 22  3b 89 28 31 30 2d a9 28  |6);"ELK";.(10-.(|
00001680  6e 24 29 81 32 2b a9 28  6e 24 29 83 32 29 3b 6e  |n$).2+.(n$).2);n|
00001690  24 3b 89 28 31 30 2d a9  28 6e 24 29 81 32 29 3b  |$;.(10-.(n$).2);|
000016a0  22 44 72 61 77 6e 22 27  27 89 28 32 29 3b 0d 0c  |"Drawn"''.(2);..|
000016b0  08 0c e3 20 4e 25 3d 30  b8 32 0d 0c 12 14 f1 3b  |... N%=0.2.....;|
000016c0  89 28 37 29 3b 77 69 6e  25 28 4e 25 29 3b 0d 0c  |.(7);win%(N%);..|
000016d0  1c 05 ed 0d 0c 26 2d f1  27 27 22 55 6e 70 6c 61  |.....&-.''"Unpla|
000016e0  79 65 64 20 68 61 6e 64  73 3a 20 22 27 27 27 27  |yed hands: "''''|
000016f0  6e 24 27 27 27 27 27 27  22 45 4c 4b 22 27 27 27  |n$''''''"ELK"'''|
00001700  0d 0c 30 23 f1 27 27 22  50 72 65 73 73 20 61 6e  |..0#.''"Press an|
00001710  79 20 6b 65 79 20 74 6f  20 63 6f 6e 74 69 6e 75  |y key to continu|
00001720  65 2e 22 0d 0c 3a 2e e3  20 4e 25 3d 31 b8 32 3a  |e."..:.. N%=1.2:|
00001730  f2 64 69 73 70 68 61 6e  64 28 4e 25 2d 31 2c 4e  |.disphand(N%-1,N|
00001740  25 29 3a 74 6f 74 25 28  4e 25 2d 31 29 3d 30 3a  |%):tot%(N%-1)=0:|
00001750  ed 0d 0c 44 07 6b 3d a5  0d 0c 4e 05 e1 0d 0c 58  |...D.k=...N....X|
00001760  05 3a 0d 0c 62 0b dd f2  73 6f 75 6e 64 0d 0c 6c  |.:..b...sound..l|
00001770  21 e7 20 57 54 20 d4 31  2c 2d 31 35 2c 31 30 30  |!. WT .1,-15,100|
00001780  2c 34 3a d4 31 2c 2d 31  35 2c 31 30 2c 36 0d 0c  |,4:.1,-15,10,6..|
00001790  76 11 e7 20 57 54 20 47  3d a6 28 31 30 30 29 0d  |v.. WT G=.(100).|
000017a0  0c 80 24 e7 20 74 6f 74  25 28 50 25 29 3c 39 20  |..$. tot%(P%)<9 |
000017b0  74 6f 74 25 28 50 25 29  3d 74 6f 74 25 28 50 25  |tot%(P%)=tot%(P%|
000017c0  29 2b 31 0d 0c 8a 05 e1  0d ff                    |)+1.......|
000017ca
GAMES1/DOMINOS.m0
GAMES1/DOMINOS.m1
GAMES1/DOMINOS.m2
GAMES1/DOMINOS.m4
GAMES1/DOMINOS.m5