Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF » G/CASTLE2

G/CASTLE2

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_User_Group » EUG_21.ADF
Filename: G/CASTLE2
Read OK:
File size: 15C0 bytes
Load address: FFFF1D00
Exec address: FFFF8023
File contents
   10REM **************************
   20REM Beleaguered Castle, Part 2
   30REM By R.A.Dimond
   40REM (c) October 1992
   50REM Version 2, June 1995
   60REM **************************
   70ONERROR IF ERR=17 RUN ELSE MODE6:REPORT:PRINT" at line ";ERL:END
   80*FX21,0
   90IF PAGE>&E00 GOTO1780
  100MODE1:VDU23,1,0;0;0;0;:G=RND(-TIME)
  110DIM N%(48),c%(48),s%(48),C%(8,16),S%(8,16),A%(4),D%(8)
  120m$="":move%=0
  130REPEAT:VDU26,4:CLS:PROCrandom:PROCinit:PROCdeal:win%=FALSE
  140REPEAT:VDU26,4
  150VDU28,0,31,39,28:CLS
  160PROCenter
  170IFchk=FALSE GOTO200
  180PROCcheck
  190IFmv%=FALSE THEN VDU7:m$=LEFT$(m$,LENm$-2):PRINTTAB(10)"You can't move there!";:TIME=0:REPEATUNTILTIME>200:OSCLI"FX15":GOTO150
  200move%=move%+1:PROCfrom:PROCto
  210IFA%(1)=13 ANDA%(2)=13 ANDA%(3)=13 ANDA%(4)=13 THENwin%=TRUE
  220UNTILwin%=TRUE
  230IFwin%=TRUE THEN TIME=0:REPEATUNTILTIME=500:MODE6:PROCwin
  240UNTIL0 ORK$="N"
  250END
  260DEFPROCrandom
  270*FX15
  280INPUT''"Enter Deal No. "M%
  290IFM%=0 M%=ABS(RND(-TIME))
  300G=RND(-M%)
  310FORI%=1TO48:N%(I%)=I%:NEXT:FORI%=48 TO2STEP-1:D%=RND(I%):T%=N%(D%):N%(D%)=N%(I%):N%(I%)=T%:NEXTI%
  320RESTORE:FORi%=1TO48:READc%(i%),s%(i%):NEXT
  330CLS
  340ENDPROC
  350DATA8,1,3,2,11,4,12,1,4,2,9,1,6,2,2,3,7,3,10,3,5,2,13,2,5,1,2,4,10,2,8,2,6,1,3,1,9,4,11,3,7,2,13,4,4,3,12,2
  360DATA10,1,12,4,4,1,13,1,8,3,2,1,7,1,11,2,3,4,9,2,6,4,13,3,7,4,2,2,11,1,5,3,9,3,6,3,4,4,10,4,3,3,8,4,5,4,12,3
  370DEFPROCcard:suit%=S%+223:IFS%=1ORS%=3colour=1:GC=0ELSEIFS%=2ORS%=4colour=0:GC=1
  380GCOL0,0:MOVEX%-4,Y%+14:DRAWX%+164,Y%+14:DRAWX%+164,Y%-201:DRAWX%-4,Y%-201:DRAWX%-4,Y%+14
  390VDU5,24,X%;Y%-197;X%+160;Y%+10;:GCOL0,131:CLG
  400GCOL0,colour:SOUND0,-15,4,1:MOVEX%+5,Y%-32:VDUsuit%:MOVEX%+128,Y%-134:PROCinv(suit%):VDU255
  410ON C% GOSUB430,440,450,460,470,480,490,500,510,520,540,550,560,570
  420ENDPROC
  430MOVEX%+128,Y%-168:PROCinv(65):VDU255:PROC1(80,0):MOVEX%+5,Y%:VDU65:RETURN
  440PROCc:PROC1(28,0):PROC1(132,1):RETURN
  450PROCc:PROC1(28,0):PROC1(80,0):PROC1(132,1):RETURN
  460PROCc:PROC2(28,0):PROC2(132,1):RETURN
  470PROCc:PROC2(28,0):PROC1(80,0):PROC2(132,1):RETURN
  480PROCc:PROC2(28,0):PROC2(80,0):PROC2(132,1):RETURN
  490PROCc:PROC2(28,0):PROC2(80,0):PROC2(132,1):PROC1(54,0):RETURN
  500PROCc:PROC2(28,0):PROC2(80,0):PROC2(132,1):PROC1(54,0):PROC1(104,1):RETURN
  510PROCc:PROC2(28,0):PROC2(62,0):PROC2(94,1):PROC2(132,1):PROC1(80,0):RETURN
  520MOVEX%+128,Y%-168:PROCinv(229):VDU255:MOVEX%+5,Y%:VDU229:PROC2(28,0):PROC2(62,0):PROC2(94,1):PROC2(132,1):PROC1(44,0):PROC1(116,1):RETURN
  530PROC2(28,0):PROC2(62,0):PROC2(94,1):PROC2(132,1):PROC1(44,0):PROC1(116,1):RETURN
  540PROCj:RETURN
  550PROCq:RETURN
  560PROCk:RETURN
  570RETURN
  580DEFPROCc:MOVEX%+5,Y%:VDU48+C%:MOVEX%+128,Y%-168:PROCinv(48+C%):VDU255:ENDPROC
  590DEFPROC1(Z%,F%):MOVEX%+64,Y%-Z%:IFF% PROCinv(suit%):VDU255 ELSEVDUsuit%
  600ENDPROC
  610DEFPROC2(Z%,F%):MOVEX%+32,Y%-Z%:IFF% PROCinv(suit%):VDU255 ELSEVDUsuit%
  620MOVEX%+96,Y%-Z%:IFF% PROCinv(suit%):VDU255 ELSEVDUsuit%
  630ENDPROC
  640DEFPROC5:MOVEX%+64,Y%-48:VDUsuit%:ENDPROC
  650DEFPROC6:MOVEX%+64,Y%-48:VDUsuit%:MOVEX%+64,Y%-108:VDUsuit%:ENDPROC
  660DEFPROC7:T$=CHR$suit%+CHR$8+CHR$10:t$=STRING$(4,T$):MOVEX%+28,Y%-26:PRINTt$:MOVEX%+100,Y%-26:PRINTt$:ENDPROC
  670DEFPROC8:MOVEX%+64,Y%-48:VDUsuit%:MOVEX%+64,Y%-110:VDUsuit%:ENDPROC
  680DEFPROCj:MOVEX%+1,Y%:VDU74:MOVEX%+128,Y%-168:PROCinv(74):VDU255
  690MOVEX%+65,Y%-14:VDU18,0,GC,253,231,8,8,10,239,240,8,8,8,10,18,0,2,241,18,0,GC,252,18,0,2,242,8,8,8,10,18,0,GC,243,244,8,8,10,245,246:PROCdraw:ENDPROC
  700DEFPROCq:MOVEX%+1,Y%:VDU81:MOVEX%+128,Y%-168:PROCinv(81):VDU255
  710MOVEX%+65,Y%-14:VDU18,0,GC,247,248,8,8,10,249,250,8,8,8,10,18,0,2,241,18,0,GC,252,18,0,2,242,8,8,8,10,18,0,GC,233,234,8,8,10,235,236:PROCdraw:ENDPROC 
  720DEFPROCk:MOVEX%+1,Y%:VDU75:MOVEX%+128,Y%-168:PROCinv(75):VDU255:GOTO690
  730DEFPROCdraw:MOVEX%+32,Y%-14:GCOL0,0:DRAWX%+130,Y%-14:DRAWX%+130,Y%-171:DRAWX%+32,Y%-171:DRAWX%+32,Y%-14
  740GCOL0,colour:MOVEX%+36,Y%-35:VDUsuit%:MOVEX%+96,Y%-130:PROCinv(suit%):VDU255:ENDPROC
  750DEFPROCinit
  760FORn%=1TO4:A%(n%)=1:NEXT:FORn%=1TO8:D%(n%)=6:NEXT
  770X%=560:FORn%=1TO4:Y%=1224-224*n%
  780C%=1:S%=n%:PROCcard
  790NEXT
  800n%=1:FORI%=1TO8:FORJ%=1TO6
  810C%(I%,J%)=c%(N%(n%)):S%(I%,J%)=s%(N%(n%)):n%=n%+1
  820NEXT:NEXT
  830ENDPROC
  840DEFPROCdeal
  850Y%=1000:FORI%=1TO8
  860IFI%>4 THENK%=844 ELSEK%=56
  870FORJ%=1TO6:X%=K%+40*(J%-1)
  880C%=C%(I%,J%):S%=S%(I%,J%)
  890PROCcard
  900NEXT
  910IFI%=4 THENY%=1000 ELSEY%=Y%-224
  920NEXT
  930VDU26,4:FORn%=1TO4:PRINTTAB(16,n%*7-4);n%:NEXT
  940FORn%=1TO8:IFn%>4 THENx%=25:y%=n%-4 ELSEx%=0:y%=n%
  950PRINTTAB(x%,7*y%-4)CHR$(64+n%);:NEXT
  960ENDPROC
  970DEFPROCenter
  980PRINTTAB(0,1);"Deal No. ";M%
  990PRINTTAB(18,1);"Move No. ";move%
 1000PRINTTAB(6,2);"Move from? ";
 1010flag%=FALSE:PROCkey
 1020IFK$="U" ENDPROC
 1030chk=TRUE
 1040from%=a%
 1050PRINTK$
 1060PRINTTAB(26,2);"Move to? ";
 1070flag%=TRUE:PROCkey
 1080to%=a%
 1090PRINTK$
 1100ENDPROC
 1110DEFPROCkey
 1120IFflag% A$="ABCDEFGH1234" ELSE A$="ABCDEFGHU"
 1130REPEAT:a%=INSTR(A$,GET$):UNTILa%
 1140K$=MID$(A$,a%,1)
 1150IFK$="U" chk=FALSE:PROCundo:ENDPROC 
 1160m$=m$+K$
 1170IF LENm$>12 m$=RIGHT$(m$,12)
 1180ENDPROC
 1190DEFPROCcheck:mv%=TRUE
 1200IFD%(from%)=0 mv%=FALSE:ENDPROC
 1210IFto%<9:PROCcheck2:ENDPROC
 1220IFS%(from%,D%(from%))<>(to%-8) mv%=FALSE:ENDPROC
 1230IFC%(from%,D%(from%))<>A%(to%-8)+1 mv%=FALSE:ENDPROC
 1240ENDPROC
 1250DEFPROCcheck2
 1260IFD%(to%)=16 mv%=FALSE:ENDPROC
 1270IFD%(to%)=0 mv%=TRUE:ENDPROC
 1280IFC%(from%,D%(from%))+1<>C%(to%,D%(to%)) mv%=FALSE:ENDPROC
 1290ENDPROC
 1300DEFPROCundo
 1310mv%=TRUE
 1320IF LEN(m$)<=0 mv%=FALSE:chk=TRUE:ENDPROC
 1330A$="ABCDEFGH1234"
 1340s$=RIGHT$(m$,2):m$=LEFT$(m$,LENm$-2)
 1350from%=INSTR(A$,RIGHT$(s$,1))
 1360to%=INSTR(A$,LEFT$(s$,1))
 1370ENDPROC
 1380DEFPROCinv(L%):?&56=L%:CALL&900:ENDPROC
 1390DEFPROCfrom
 1400IFfrom%>8 GOTO1530
 1410C1%=C%(from%,D%(from%)):S1%=S%(from%,D%(from%))
 1420C%(from%,D%(from%))=0:S%(from%,D%(from%))=0
 1430D%(from%)=D%(from%)-1:Z%=1
 1440IFD%(from%)>6 THENZ%=D%(from%)-6
 1450IFfrom%>4 K%=844:Y%=1224-224*(from%-4) ELSEK%=56:Y%=1224-224*(from%)
 1460GCOL0,128:VDU24,K%;Y%-197;K%+400;Y%+10;:CLG
 1470IF D%(from%)=0 GOTO1520
 1480I%=from%:FORJ%=Z%TO D%(from%):X%=K%+40*(J%-Z%)
 1490C%=C%(I%,J%):S%=S%(I%,J%)
 1500PROCcard
 1510NEXT
 1520ENDPROC
 1530from%=from%-8
 1540C1%=A%(from%):S1%=from%
 1550A%(from%)=A%(from%)-1
 1560X%=560:Y%=1224-224*from%
 1570C%=A%(from%):S%=from%
 1580PROCcard
 1590ENDPROC
 1600DEFPROCto
 1610IFto%>8 GOTO1720
 1620D%(to%)=D%(to%)+1:Z%=1
 1630IF D%(to%)>7 Z%=D%(to%)-6
 1640C%(to%,D%(to%))=C1%:S%(to%,D%(to%))=S1%
 1650IFto%>4 K%=844:Y%=1224-224*(to%-4) ELSEK%=56:Y%=1224-224*(to%)
 1660GCOL0,128:VDU24,K%;Y%-197;K%+400;Y%+10;:CLG
 1670I%=to%:FORJ%=Z% TO D%(to%):X%=K%+40*(J%-Z%)
 1680C%=C%(I%,J%):S%=S%(I%,J%)
 1690PROCcard
 1700NEXT
 1710ENDPROC
 1720to%=to%-8
 1730A%(to%)=A%(to%)+1
 1740X%=560:Y%=1224-224*to%
 1750C%=A%(to%):S%=to%
 1760PROCcard
 1770ENDPROC
 1780*K.0 *T.|MFORI%=0TO TOP-PAGE STEP4:I%!&E00=I%!PAGE:NEXT|MPAGE=&E00|MOLD|MRUN|M
 1790*FX138,0,128
 1800END
 1810DEFPROCwin:VDU23,1,0;0;0;0;
 1820PRINTTAB(11,4)"CONGRATULATIONS!!"
 1830PRINTTAB(11,5)"-----------------"
 1840PRINTTAB(4,8)"You have completed Deal no. ";M%
 1850PRINTTAB(13,10)"in ";move%;" moves"
 1860PRINTTAB(10,14)"Another deal?  (Y/N)"
 1870REPEAT:K$=INKEY$0:UNTILK$="Y" ORK$="N"
 1880move%=0:ENDPROC

 � **************************
 � Beleaguered Castle, Part 2
� By R.A.Dimond
(� (c) October 1992
2� Version 2, June 1995
< � **************************
F'� � �=17 � � �6:�:�" at line ";�:�
P*FX21,0
Z� �>&E00 �dtF
d�1:�23,1,0;0;0;0;:G=�(-�)
n8� N%(48),c%(48),s%(48),C%(8,16),S%(8,16),A%(4),D%(8)
xm$="":move%=0
�(�:�26,4:�:�random:�init:�deal:win%=�
��:�26,4
��28,0,31,39,28:�
�
�enter
��chk=� �dH@
�
�check
�U�mv%=� � �7:m$=�m$,�m$-2):�10)"You can't move there!";:�=0:���>200:�"FX15":�tV@
�move%=move%+1:�from:�to
�3�A%(1)=13 �A%(2)=13 �A%(3)=13 �A%(4)=13 �win%=�
��win%=�
�!�win%=� � �=0:���=500:�6:�win
��0 �K$="N"
��
��random
	*FX15
�''"Enter Deal No. "M%
"�M%=0 M%=�(�(-�))
,G=�(-M%)
6T�I%=1�48:N%(I%)=I%:�:�I%=48 �2�-1:D%=�(I%):T%=N%(D%):N%(D%)=N%(I%):N%(I%)=T%:�I%
@�:�i%=1�48:�c%(i%),s%(i%):�
J�
T�
^l�8,1,3,2,11,4,12,1,4,2,9,1,6,2,2,3,7,3,10,3,5,2,13,2,5,1,2,4,10,2,8,2,6,1,3,1,9,4,11,3,7,2,13,4,4,3,12,2
hl�10,1,12,4,4,1,13,1,8,3,2,1,7,1,11,2,3,4,9,2,6,4,13,3,7,4,2,2,11,1,5,3,9,3,6,3,4,4,10,4,3,3,8,4,5,4,12,3
rG��card:suit%=S%+223:�S%=1�S%=3colour=1:GC=0��S%=2�S%=4colour=0:GC=1
|J�0,0:�X%-4,Y%+14:�X%+164,Y%+14:�X%+164,Y%-201:�X%-4,Y%-201:�X%-4,Y%+14
�*�5,24,X%;Y%-197;X%+160;Y%+10;:�0,131:�
�K�0,colour:�0,-15,4,1:�X%+5,Y%-32:�suit%:�X%+128,Y%-134:�inv(suit%):�255
�O� C% �tnA,�txA,�dBA,�dLA,�dVA,�d`A,�djA,�dtA,�d~A,�THB,�T\B,�TfB,�TpB,�TzB
��
�8�X%+128,Y%-168:�inv(65):�255:�1(80,0):�X%+5,Y%:�65:�
��c:�1(28,0):�1(132,1):�
�$�c:�1(28,0):�1(80,0):�1(132,1):�
��c:�2(28,0):�2(132,1):�
�$�c:�2(28,0):�1(80,0):�2(132,1):�
�$�c:�2(28,0):�2(80,0):�2(132,1):�
�-�c:�2(28,0):�2(80,0):�2(132,1):�1(54,0):�
�7�c:�2(28,0):�2(80,0):�2(132,1):�1(54,0):�1(104,1):�
�6�c:�2(28,0):�2(62,0):�2(94,1):�2(132,1):�1(80,0):�
i�X%+128,Y%-168:�inv(229):�255:�X%+5,Y%:�229:�2(28,0):�2(62,0):�2(94,1):�2(132,1):�1(44,0):�1(116,1):�
=�2(28,0):�2(62,0):�2(94,1):�2(132,1):�1(44,0):�1(116,1):�
�j:�
&�q:�
0�k:�
:�
D9��c:�X%+5,Y%:�48+C%:�X%+128,Y%-168:�inv(48+C%):�255:�
N8��1(Z%,F%):�X%+64,Y%-Z%:�F% �inv(suit%):�255 ��suit%
X�
b8��2(Z%,F%):�X%+32,Y%-Z%:�F% �inv(suit%):�255 ��suit%
l-�X%+96,Y%-Z%:�F% �inv(suit%):�255 ��suit%
v�
���5:�X%+64,Y%-48:�suit%:�
�2��6:�X%+64,Y%-48:�suit%:�X%+64,Y%-108:�suit%:�
�G��7:T$=�suit%+�8+�10:t$=�4,T$):�X%+28,Y%-26:�t$:�X%+100,Y%-26:�t$:�
�2��8:�X%+64,Y%-48:�suit%:�X%+64,Y%-110:�suit%:�
�1��j:�X%+1,Y%:�74:�X%+128,Y%-168:�inv(74):�255
���X%+65,Y%-14:�18,0,GC,253,231,8,8,10,239,240,8,8,8,10,18,0,2,241,18,0,GC,252,18,0,2,242,8,8,8,10,18,0,GC,243,244,8,8,10,245,246:�draw:�
�1��q:�X%+1,Y%:�81:�X%+128,Y%-168:�inv(81):�255
ƌ�X%+65,Y%-14:�18,0,GC,247,248,8,8,10,249,250,8,8,8,10,18,0,2,241,18,0,GC,252,18,0,2,242,8,8,8,10,18,0,GC,233,234,8,8,10,235,236:�draw:� 
�7��k:�X%+1,Y%:�75:�X%+128,Y%-168:�inv(75):�255:�trB
�T��draw:�X%+32,Y%-14:�0,0:�X%+130,Y%-14:�X%+130,Y%-171:�X%+32,Y%-171:�X%+32,Y%-14
�B�0,colour:�X%+36,Y%-35:�suit%:�X%+96,Y%-130:�inv(suit%):�255:�
�
��init
�)�n%=1�4:A%(n%)=1:�:�n%=1�8:D%(n%)=6:�
!X%=560:�n%=1�4:Y%=1224-224*n%
C%=1:S%=n%:�card
�
 n%=1:�I%=1�8:�J%=1�6
*5C%(I%,J%)=c%(N%(n%)):S%(I%,J%)=s%(N%(n%)):n%=n%+1
4�:�
>�
H
��deal
RY%=1000:�I%=1�8
\�I%>4 �K%=844 �K%=56
f�J%=1�6:X%=K%+40*(J%-1)
pC%=C%(I%,J%):S%=S%(I%,J%)
z	�card
��
��I%=4 �Y%=1000 �Y%=Y%-224
��
�#�26,4:�n%=1�4:�16,n%*7-4);n%:�
�,�n%=1�8:�n%>4 �x%=25:y%=n%-4 �x%=0:y%=n%
��x%,7*y%-4)�(64+n%);:�
��
���enter
��0,1);"Deal No. ";M%
��18,1);"Move No. ";move%
��6,2);"Move from? ";
�flag%=�:�key
�
�K$="U" �
	chk=�
from%=a%
�K$
$�26,2);"Move to? ";
.flag%=�:�key
8
to%=a%
B�K$
L�
V	��key
`-�flag% A$="ABCDEFGH1234" � A$="ABCDEFGHU"
j�:a%=�A$,�):�a%
tK$=�A$,a%,1)
~�K$="U" chk=�:�undo:� 
�m$=m$+K$
�� �m$>12 m$=�m$,12)
��
���check:mv%=�
��D%(from%)=0 mv%=�:�
��to%<9:�check2:�
�)�S%(from%,D%(from%))<>(to%-8) mv%=�:�
�-�C%(from%,D%(from%))<>A%(to%-8)+1 mv%=�:�
��
���check2
��D%(to%)=16 mv%=�:�
��D%(to%)=0 mv%=�:�
3�C%(from%,D%(from%))+1<>C%(to%,D%(to%)) mv%=�:�

�

��undo
	mv%=�
(� �(m$)<=0 mv%=�:chk=�:�
2A$="ABCDEFGH1234"
<s$=�m$,2):m$=�m$,�m$-2)
Ffrom%=�A$,�s$,1))
Pto%=�A$,�s$,1))
Z�
d��inv(L%):?&56=L%:�&900:�
n
��from
x�from%>8 �dzE
�3C1%=C%(from%,D%(from%)):S1%=S%(from%,D%(from%))
�/C%(from%,D%(from%))=0:S%(from%,D%(from%))=0
�D%(from%)=D%(from%)-1:Z%=1
� �D%(from%)>6 �Z%=D%(from%)-6
�D�from%>4 K%=844:Y%=1224-224*(from%-4) �K%=56:Y%=1224-224*(from%)
�(�0,128:�24,K%;Y%-197;K%+400;Y%+10;:�
�� D%(from%)=0 �dpE
�/I%=from%:�J%=Z%� D%(from%):X%=K%+40*(J%-Z%)
�C%=C%(I%,J%):S%=S%(I%,J%)
�	�card
��
��
�from%=from%-8
C1%=A%(from%):S1%=from%
A%(from%)=A%(from%)-1
X%=560:Y%=1224-224*from%
"C%=A%(from%):S%=from%
,	�card
6�
@��to
J�to%>8 �txF
TD%(to%)=D%(to%)+1:Z%=1
^� D%(to%)>7 Z%=D%(to%)-6
h+C%(to%,D%(to%))=C1%:S%(to%,D%(to%))=S1%
r>�to%>4 K%=844:Y%=1224-224*(to%-4) �K%=56:Y%=1224-224*(to%)
|(�0,128:�24,K%;Y%-197;K%+400;Y%+10;:�
�,I%=to%:�J%=Z% � D%(to%):X%=K%+40*(J%-Z%)
�C%=C%(I%,J%):S%=S%(I%,J%)
�	�card
��
��
�
to%=to%-8
�A%(to%)=A%(to%)+1
�X%=560:Y%=1224-224*to%
�C%=A%(to%):S%=to%
�	�card
��
�R*K.0 *T.|MFORI%=0TO TOP-PAGE STEP4:I%!&E00=I%!PAGE:NEXT|MPAGE=&E00|MOLD|MRUN|M
�*FX138,0,128
�
��win:�23,1,0;0;0;0;
�11,4)"CONGRATULATIONS!!"
&�11,5)"-----------------"
0+�4,8)"You have completed Deal no. ";M%
: �13,10)"in ";move%;" moves"
D"�10,14)"Another deal?  (Y/N)"
N�:K$=�0:�K$="Y" �K$="N"
X
move%=0:�
�
00000000  0d 00 0a 20 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |... . **********|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000020  0d 00 14 20 f4 20 42 65  6c 65 61 67 75 65 72 65  |... . Beleaguere|
00000030  64 20 43 61 73 74 6c 65  2c 20 50 61 72 74 20 32  |d Castle, Part 2|
00000040  0d 00 1e 13 f4 20 42 79  20 52 2e 41 2e 44 69 6d  |..... By R.A.Dim|
00000050  6f 6e 64 0d 00 28 16 f4  20 28 63 29 20 4f 63 74  |ond..(.. (c) Oct|
00000060  6f 62 65 72 20 31 39 39  32 0d 00 32 1a f4 20 56  |ober 1992..2.. V|
00000070  65 72 73 69 6f 6e 20 32  2c 20 4a 75 6e 65 20 31  |ersion 2, June 1|
00000080  39 39 35 0d 00 3c 20 f4  20 2a 2a 2a 2a 2a 2a 2a  |995..< . *******|
00000090  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000000a0  2a 2a 2a 0d 00 46 27 ee  85 20 e7 20 9f 3d 31 37  |***..F'.. . .=17|
000000b0  20 f9 20 8b 20 eb 36 3a  f6 3a f1 22 20 61 74 20  | . . .6:.:." at |
000000c0  6c 69 6e 65 20 22 3b 9e  3a e0 0d 00 50 0b 2a 46  |line ";.:...P.*F|
000000d0  58 32 31 2c 30 0d 00 5a  12 e7 20 90 3e 26 45 30  |X21,0..Z.. .>&E0|
000000e0  30 20 e5 8d 64 74 46 0d  00 64 1d eb 31 3a ef 32  |0 ..dtF..d..1:.2|
000000f0  33 2c 31 2c 30 3b 30 3b  30 3b 30 3b 3a 47 3d b3  |3,1,0;0;0;0;:G=.|
00000100  28 2d 91 29 0d 00 6e 38  de 20 4e 25 28 34 38 29  |(-.)..n8. N%(48)|
00000110  2c 63 25 28 34 38 29 2c  73 25 28 34 38 29 2c 43  |,c%(48),s%(48),C|
00000120  25 28 38 2c 31 36 29 2c  53 25 28 38 2c 31 36 29  |%(8,16),S%(8,16)|
00000130  2c 41 25 28 34 29 2c 44  25 28 38 29 0d 00 78 11  |,A%(4),D%(8)..x.|
00000140  6d 24 3d 22 22 3a 6d 6f  76 65 25 3d 30 0d 00 82  |m$="":move%=0...|
00000150  28 f5 3a ef 32 36 2c 34  3a db 3a f2 72 61 6e 64  |(.:.26,4:.:.rand|
00000160  6f 6d 3a f2 69 6e 69 74  3a f2 64 65 61 6c 3a 77  |om:.init:.deal:w|
00000170  69 6e 25 3d a3 0d 00 8c  0b f5 3a ef 32 36 2c 34  |in%=......:.26,4|
00000180  0d 00 96 14 ef 32 38 2c  30 2c 33 31 2c 33 39 2c  |.....28,0,31,39,|
00000190  32 38 3a db 0d 00 a0 0a  f2 65 6e 74 65 72 0d 00  |28:......enter..|
000001a0  aa 10 e7 63 68 6b 3d a3  20 e5 8d 64 48 40 0d 00  |...chk=. ..dH@..|
000001b0  b4 0a f2 63 68 65 63 6b  0d 00 be 55 e7 6d 76 25  |...check...U.mv%|
000001c0  3d a3 20 8c 20 ef 37 3a  6d 24 3d c0 6d 24 2c a9  |=. . .7:m$=.m$,.|
000001d0  6d 24 2d 32 29 3a f1 8a  31 30 29 22 59 6f 75 20  |m$-2):..10)"You |
000001e0  63 61 6e 27 74 20 6d 6f  76 65 20 74 68 65 72 65  |can't move there|
000001f0  21 22 3b 3a d1 3d 30 3a  f5 fd 91 3e 32 30 30 3a  |!";:.=0:...>200:|
00000200  ff 22 46 58 31 35 22 3a  e5 8d 74 56 40 0d 00 c8  |."FX15":..tV@...|
00000210  1b 6d 6f 76 65 25 3d 6d  6f 76 65 25 2b 31 3a f2  |.move%=move%+1:.|
00000220  66 72 6f 6d 3a f2 74 6f  0d 00 d2 33 e7 41 25 28  |from:.to...3.A%(|
00000230  31 29 3d 31 33 20 80 41  25 28 32 29 3d 31 33 20  |1)=13 .A%(2)=13 |
00000240  80 41 25 28 33 29 3d 31  33 20 80 41 25 28 34 29  |.A%(3)=13 .A%(4)|
00000250  3d 31 33 20 8c 77 69 6e  25 3d b9 0d 00 dc 0b fd  |=13 .win%=......|
00000260  77 69 6e 25 3d b9 0d 00  e6 21 e7 77 69 6e 25 3d  |win%=....!.win%=|
00000270  b9 20 8c 20 d1 3d 30 3a  f5 fd 91 3d 35 30 30 3a  |. . .=0:...=500:|
00000280  eb 36 3a f2 77 69 6e 0d  00 f0 0e fd 30 20 84 4b  |.6:.win.....0 .K|
00000290  24 3d 22 4e 22 0d 00 fa  05 e0 0d 01 04 0c dd f2  |$="N"...........|
000002a0  72 61 6e 64 6f 6d 0d 01  0e 09 2a 46 58 31 35 0d  |random....*FX15.|
000002b0  01 18 1a e8 27 27 22 45  6e 74 65 72 20 44 65 61  |....''"Enter Dea|
000002c0  6c 20 4e 6f 2e 20 22 4d  25 0d 01 22 15 e7 4d 25  |l No. "M%.."..M%|
000002d0  3d 30 20 4d 25 3d 94 28  b3 28 2d 91 29 29 0d 01  |=0 M%=.(.(-.))..|
000002e0  2c 0c 47 3d b3 28 2d 4d  25 29 0d 01 36 54 e3 49  |,.G=.(-M%)..6T.I|
000002f0  25 3d 31 b8 34 38 3a 4e  25 28 49 25 29 3d 49 25  |%=1.48:N%(I%)=I%|
00000300  3a ed 3a e3 49 25 3d 34  38 20 b8 32 88 2d 31 3a  |:.:.I%=48 .2.-1:|
00000310  44 25 3d b3 28 49 25 29  3a 54 25 3d 4e 25 28 44  |D%=.(I%):T%=N%(D|
00000320  25 29 3a 4e 25 28 44 25  29 3d 4e 25 28 49 25 29  |%):N%(D%)=N%(I%)|
00000330  3a 4e 25 28 49 25 29 3d  54 25 3a ed 49 25 0d 01  |:N%(I%)=T%:.I%..|
00000340  40 1f f7 3a e3 69 25 3d  31 b8 34 38 3a f3 63 25  |@..:.i%=1.48:.c%|
00000350  28 69 25 29 2c 73 25 28  69 25 29 3a ed 0d 01 4a  |(i%),s%(i%):...J|
00000360  05 db 0d 01 54 05 e1 0d  01 5e 6c dc 38 2c 31 2c  |....T....^l.8,1,|
00000370  33 2c 32 2c 31 31 2c 34  2c 31 32 2c 31 2c 34 2c  |3,2,11,4,12,1,4,|
00000380  32 2c 39 2c 31 2c 36 2c  32 2c 32 2c 33 2c 37 2c  |2,9,1,6,2,2,3,7,|
00000390  33 2c 31 30 2c 33 2c 35  2c 32 2c 31 33 2c 32 2c  |3,10,3,5,2,13,2,|
000003a0  35 2c 31 2c 32 2c 34 2c  31 30 2c 32 2c 38 2c 32  |5,1,2,4,10,2,8,2|
000003b0  2c 36 2c 31 2c 33 2c 31  2c 39 2c 34 2c 31 31 2c  |,6,1,3,1,9,4,11,|
000003c0  33 2c 37 2c 32 2c 31 33  2c 34 2c 34 2c 33 2c 31  |3,7,2,13,4,4,3,1|
000003d0  32 2c 32 0d 01 68 6c dc  31 30 2c 31 2c 31 32 2c  |2,2..hl.10,1,12,|
000003e0  34 2c 34 2c 31 2c 31 33  2c 31 2c 38 2c 33 2c 32  |4,4,1,13,1,8,3,2|
000003f0  2c 31 2c 37 2c 31 2c 31  31 2c 32 2c 33 2c 34 2c  |,1,7,1,11,2,3,4,|
00000400  39 2c 32 2c 36 2c 34 2c  31 33 2c 33 2c 37 2c 34  |9,2,6,4,13,3,7,4|
00000410  2c 32 2c 32 2c 31 31 2c  31 2c 35 2c 33 2c 39 2c  |,2,2,11,1,5,3,9,|
00000420  33 2c 36 2c 33 2c 34 2c  34 2c 31 30 2c 34 2c 33  |3,6,3,4,4,10,4,3|
00000430  2c 33 2c 38 2c 34 2c 35  2c 34 2c 31 32 2c 33 0d  |,3,8,4,5,4,12,3.|
00000440  01 72 47 dd f2 63 61 72  64 3a 73 75 69 74 25 3d  |.rG..card:suit%=|
00000450  53 25 2b 32 32 33 3a e7  53 25 3d 31 84 53 25 3d  |S%+223:.S%=1.S%=|
00000460  33 63 6f 6c 6f 75 72 3d  31 3a 47 43 3d 30 8b e7  |3colour=1:GC=0..|
00000470  53 25 3d 32 84 53 25 3d  34 63 6f 6c 6f 75 72 3d  |S%=2.S%=4colour=|
00000480  30 3a 47 43 3d 31 0d 01  7c 4a e6 30 2c 30 3a ec  |0:GC=1..|J.0,0:.|
00000490  58 25 2d 34 2c 59 25 2b  31 34 3a df 58 25 2b 31  |X%-4,Y%+14:.X%+1|
000004a0  36 34 2c 59 25 2b 31 34  3a df 58 25 2b 31 36 34  |64,Y%+14:.X%+164|
000004b0  2c 59 25 2d 32 30 31 3a  df 58 25 2d 34 2c 59 25  |,Y%-201:.X%-4,Y%|
000004c0  2d 32 30 31 3a df 58 25  2d 34 2c 59 25 2b 31 34  |-201:.X%-4,Y%+14|
000004d0  0d 01 86 2a ef 35 2c 32  34 2c 58 25 3b 59 25 2d  |...*.5,24,X%;Y%-|
000004e0  31 39 37 3b 58 25 2b 31  36 30 3b 59 25 2b 31 30  |197;X%+160;Y%+10|
000004f0  3b 3a e6 30 2c 31 33 31  3a da 0d 01 90 4b e6 30  |;:.0,131:....K.0|
00000500  2c 63 6f 6c 6f 75 72 3a  d4 30 2c 2d 31 35 2c 34  |,colour:.0,-15,4|
00000510  2c 31 3a ec 58 25 2b 35  2c 59 25 2d 33 32 3a ef  |,1:.X%+5,Y%-32:.|
00000520  73 75 69 74 25 3a ec 58  25 2b 31 32 38 2c 59 25  |suit%:.X%+128,Y%|
00000530  2d 31 33 34 3a f2 69 6e  76 28 73 75 69 74 25 29  |-134:.inv(suit%)|
00000540  3a ef 32 35 35 0d 01 9a  4f ee 20 43 25 20 e4 8d  |:.255...O. C% ..|
00000550  74 6e 41 2c 8d 74 78 41  2c 8d 64 42 41 2c 8d 64  |tnA,.txA,.dBA,.d|
00000560  4c 41 2c 8d 64 56 41 2c  8d 64 60 41 2c 8d 64 6a  |LA,.dVA,.d`A,.dj|
00000570  41 2c 8d 64 74 41 2c 8d  64 7e 41 2c 8d 54 48 42  |A,.dtA,.d~A,.THB|
00000580  2c 8d 54 5c 42 2c 8d 54  66 42 2c 8d 54 70 42 2c  |,.T\B,.TfB,.TpB,|
00000590  8d 54 7a 42 0d 01 a4 05  e1 0d 01 ae 38 ec 58 25  |.TzB........8.X%|
000005a0  2b 31 32 38 2c 59 25 2d  31 36 38 3a f2 69 6e 76  |+128,Y%-168:.inv|
000005b0  28 36 35 29 3a ef 32 35  35 3a f2 31 28 38 30 2c  |(65):.255:.1(80,|
000005c0  30 29 3a ec 58 25 2b 35  2c 59 25 3a ef 36 35 3a  |0):.X%+5,Y%:.65:|
000005d0  f8 0d 01 b8 1b f2 63 3a  f2 31 28 32 38 2c 30 29  |......c:.1(28,0)|
000005e0  3a f2 31 28 31 33 32 2c  31 29 3a f8 0d 01 c2 24  |:.1(132,1):....$|
000005f0  f2 63 3a f2 31 28 32 38  2c 30 29 3a f2 31 28 38  |.c:.1(28,0):.1(8|
00000600  30 2c 30 29 3a f2 31 28  31 33 32 2c 31 29 3a f8  |0,0):.1(132,1):.|
00000610  0d 01 cc 1b f2 63 3a f2  32 28 32 38 2c 30 29 3a  |.....c:.2(28,0):|
00000620  f2 32 28 31 33 32 2c 31  29 3a f8 0d 01 d6 24 f2  |.2(132,1):....$.|
00000630  63 3a f2 32 28 32 38 2c  30 29 3a f2 31 28 38 30  |c:.2(28,0):.1(80|
00000640  2c 30 29 3a f2 32 28 31  33 32 2c 31 29 3a f8 0d  |,0):.2(132,1):..|
00000650  01 e0 24 f2 63 3a f2 32  28 32 38 2c 30 29 3a f2  |..$.c:.2(28,0):.|
00000660  32 28 38 30 2c 30 29 3a  f2 32 28 31 33 32 2c 31  |2(80,0):.2(132,1|
00000670  29 3a f8 0d 01 ea 2d f2  63 3a f2 32 28 32 38 2c  |):....-.c:.2(28,|
00000680  30 29 3a f2 32 28 38 30  2c 30 29 3a f2 32 28 31  |0):.2(80,0):.2(1|
00000690  33 32 2c 31 29 3a f2 31  28 35 34 2c 30 29 3a f8  |32,1):.1(54,0):.|
000006a0  0d 01 f4 37 f2 63 3a f2  32 28 32 38 2c 30 29 3a  |...7.c:.2(28,0):|
000006b0  f2 32 28 38 30 2c 30 29  3a f2 32 28 31 33 32 2c  |.2(80,0):.2(132,|
000006c0  31 29 3a f2 31 28 35 34  2c 30 29 3a f2 31 28 31  |1):.1(54,0):.1(1|
000006d0  30 34 2c 31 29 3a f8 0d  01 fe 36 f2 63 3a f2 32  |04,1):....6.c:.2|
000006e0  28 32 38 2c 30 29 3a f2  32 28 36 32 2c 30 29 3a  |(28,0):.2(62,0):|
000006f0  f2 32 28 39 34 2c 31 29  3a f2 32 28 31 33 32 2c  |.2(94,1):.2(132,|
00000700  31 29 3a f2 31 28 38 30  2c 30 29 3a f8 0d 02 08  |1):.1(80,0):....|
00000710  69 ec 58 25 2b 31 32 38  2c 59 25 2d 31 36 38 3a  |i.X%+128,Y%-168:|
00000720  f2 69 6e 76 28 32 32 39  29 3a ef 32 35 35 3a ec  |.inv(229):.255:.|
00000730  58 25 2b 35 2c 59 25 3a  ef 32 32 39 3a f2 32 28  |X%+5,Y%:.229:.2(|
00000740  32 38 2c 30 29 3a f2 32  28 36 32 2c 30 29 3a f2  |28,0):.2(62,0):.|
00000750  32 28 39 34 2c 31 29 3a  f2 32 28 31 33 32 2c 31  |2(94,1):.2(132,1|
00000760  29 3a f2 31 28 34 34 2c  30 29 3a f2 31 28 31 31  |):.1(44,0):.1(11|
00000770  36 2c 31 29 3a f8 0d 02  12 3d f2 32 28 32 38 2c  |6,1):....=.2(28,|
00000780  30 29 3a f2 32 28 36 32  2c 30 29 3a f2 32 28 39  |0):.2(62,0):.2(9|
00000790  34 2c 31 29 3a f2 32 28  31 33 32 2c 31 29 3a f2  |4,1):.2(132,1):.|
000007a0  31 28 34 34 2c 30 29 3a  f2 31 28 31 31 36 2c 31  |1(44,0):.1(116,1|
000007b0  29 3a f8 0d 02 1c 08 f2  6a 3a f8 0d 02 26 08 f2  |):......j:...&..|
000007c0  71 3a f8 0d 02 30 08 f2  6b 3a f8 0d 02 3a 05 f8  |q:...0..k:...:..|
000007d0  0d 02 44 39 dd f2 63 3a  ec 58 25 2b 35 2c 59 25  |..D9..c:.X%+5,Y%|
000007e0  3a ef 34 38 2b 43 25 3a  ec 58 25 2b 31 32 38 2c  |:.48+C%:.X%+128,|
000007f0  59 25 2d 31 36 38 3a f2  69 6e 76 28 34 38 2b 43  |Y%-168:.inv(48+C|
00000800  25 29 3a ef 32 35 35 3a  e1 0d 02 4e 38 dd f2 31  |%):.255:...N8..1|
00000810  28 5a 25 2c 46 25 29 3a  ec 58 25 2b 36 34 2c 59  |(Z%,F%):.X%+64,Y|
00000820  25 2d 5a 25 3a e7 46 25  20 f2 69 6e 76 28 73 75  |%-Z%:.F% .inv(su|
00000830  69 74 25 29 3a ef 32 35  35 20 8b ef 73 75 69 74  |it%):.255 ..suit|
00000840  25 0d 02 58 05 e1 0d 02  62 38 dd f2 32 28 5a 25  |%..X....b8..2(Z%|
00000850  2c 46 25 29 3a ec 58 25  2b 33 32 2c 59 25 2d 5a  |,F%):.X%+32,Y%-Z|
00000860  25 3a e7 46 25 20 f2 69  6e 76 28 73 75 69 74 25  |%:.F% .inv(suit%|
00000870  29 3a ef 32 35 35 20 8b  ef 73 75 69 74 25 0d 02  |):.255 ..suit%..|
00000880  6c 2d ec 58 25 2b 39 36  2c 59 25 2d 5a 25 3a e7  |l-.X%+96,Y%-Z%:.|
00000890  46 25 20 f2 69 6e 76 28  73 75 69 74 25 29 3a ef  |F% .inv(suit%):.|
000008a0  32 35 35 20 8b ef 73 75  69 74 25 0d 02 76 05 e1  |255 ..suit%..v..|
000008b0  0d 02 80 1d dd f2 35 3a  ec 58 25 2b 36 34 2c 59  |......5:.X%+64,Y|
000008c0  25 2d 34 38 3a ef 73 75  69 74 25 3a e1 0d 02 8a  |%-48:.suit%:....|
000008d0  32 dd f2 36 3a ec 58 25  2b 36 34 2c 59 25 2d 34  |2..6:.X%+64,Y%-4|
000008e0  38 3a ef 73 75 69 74 25  3a ec 58 25 2b 36 34 2c  |8:.suit%:.X%+64,|
000008f0  59 25 2d 31 30 38 3a ef  73 75 69 74 25 3a e1 0d  |Y%-108:.suit%:..|
00000900  02 94 47 dd f2 37 3a 54  24 3d bd 73 75 69 74 25  |..G..7:T$=.suit%|
00000910  2b bd 38 2b bd 31 30 3a  74 24 3d c4 34 2c 54 24  |+.8+.10:t$=.4,T$|
00000920  29 3a ec 58 25 2b 32 38  2c 59 25 2d 32 36 3a f1  |):.X%+28,Y%-26:.|
00000930  74 24 3a ec 58 25 2b 31  30 30 2c 59 25 2d 32 36  |t$:.X%+100,Y%-26|
00000940  3a f1 74 24 3a e1 0d 02  9e 32 dd f2 38 3a ec 58  |:.t$:....2..8:.X|
00000950  25 2b 36 34 2c 59 25 2d  34 38 3a ef 73 75 69 74  |%+64,Y%-48:.suit|
00000960  25 3a ec 58 25 2b 36 34  2c 59 25 2d 31 31 30 3a  |%:.X%+64,Y%-110:|
00000970  ef 73 75 69 74 25 3a e1  0d 02 a8 31 dd f2 6a 3a  |.suit%:....1..j:|
00000980  ec 58 25 2b 31 2c 59 25  3a ef 37 34 3a ec 58 25  |.X%+1,Y%:.74:.X%|
00000990  2b 31 32 38 2c 59 25 2d  31 36 38 3a f2 69 6e 76  |+128,Y%-168:.inv|
000009a0  28 37 34 29 3a ef 32 35  35 0d 02 b2 8b ec 58 25  |(74):.255.....X%|
000009b0  2b 36 35 2c 59 25 2d 31  34 3a ef 31 38 2c 30 2c  |+65,Y%-14:.18,0,|
000009c0  47 43 2c 32 35 33 2c 32  33 31 2c 38 2c 38 2c 31  |GC,253,231,8,8,1|
000009d0  30 2c 32 33 39 2c 32 34  30 2c 38 2c 38 2c 38 2c  |0,239,240,8,8,8,|
000009e0  31 30 2c 31 38 2c 30 2c  32 2c 32 34 31 2c 31 38  |10,18,0,2,241,18|
000009f0  2c 30 2c 47 43 2c 32 35  32 2c 31 38 2c 30 2c 32  |,0,GC,252,18,0,2|
00000a00  2c 32 34 32 2c 38 2c 38  2c 38 2c 31 30 2c 31 38  |,242,8,8,8,10,18|
00000a10  2c 30 2c 47 43 2c 32 34  33 2c 32 34 34 2c 38 2c  |,0,GC,243,244,8,|
00000a20  38 2c 31 30 2c 32 34 35  2c 32 34 36 3a f2 64 72  |8,10,245,246:.dr|
00000a30  61 77 3a e1 0d 02 bc 31  dd f2 71 3a ec 58 25 2b  |aw:....1..q:.X%+|
00000a40  31 2c 59 25 3a ef 38 31  3a ec 58 25 2b 31 32 38  |1,Y%:.81:.X%+128|
00000a50  2c 59 25 2d 31 36 38 3a  f2 69 6e 76 28 38 31 29  |,Y%-168:.inv(81)|
00000a60  3a ef 32 35 35 0d 02 c6  8c ec 58 25 2b 36 35 2c  |:.255.....X%+65,|
00000a70  59 25 2d 31 34 3a ef 31  38 2c 30 2c 47 43 2c 32  |Y%-14:.18,0,GC,2|
00000a80  34 37 2c 32 34 38 2c 38  2c 38 2c 31 30 2c 32 34  |47,248,8,8,10,24|
00000a90  39 2c 32 35 30 2c 38 2c  38 2c 38 2c 31 30 2c 31  |9,250,8,8,8,10,1|
00000aa0  38 2c 30 2c 32 2c 32 34  31 2c 31 38 2c 30 2c 47  |8,0,2,241,18,0,G|
00000ab0  43 2c 32 35 32 2c 31 38  2c 30 2c 32 2c 32 34 32  |C,252,18,0,2,242|
00000ac0  2c 38 2c 38 2c 38 2c 31  30 2c 31 38 2c 30 2c 47  |,8,8,8,10,18,0,G|
00000ad0  43 2c 32 33 33 2c 32 33  34 2c 38 2c 38 2c 31 30  |C,233,234,8,8,10|
00000ae0  2c 32 33 35 2c 32 33 36  3a f2 64 72 61 77 3a e1  |,235,236:.draw:.|
00000af0  20 0d 02 d0 37 dd f2 6b  3a ec 58 25 2b 31 2c 59  | ...7..k:.X%+1,Y|
00000b00  25 3a ef 37 35 3a ec 58  25 2b 31 32 38 2c 59 25  |%:.75:.X%+128,Y%|
00000b10  2d 31 36 38 3a f2 69 6e  76 28 37 35 29 3a ef 32  |-168:.inv(75):.2|
00000b20  35 35 3a e5 8d 74 72 42  0d 02 da 54 dd f2 64 72  |55:..trB...T..dr|
00000b30  61 77 3a ec 58 25 2b 33  32 2c 59 25 2d 31 34 3a  |aw:.X%+32,Y%-14:|
00000b40  e6 30 2c 30 3a df 58 25  2b 31 33 30 2c 59 25 2d  |.0,0:.X%+130,Y%-|
00000b50  31 34 3a df 58 25 2b 31  33 30 2c 59 25 2d 31 37  |14:.X%+130,Y%-17|
00000b60  31 3a df 58 25 2b 33 32  2c 59 25 2d 31 37 31 3a  |1:.X%+32,Y%-171:|
00000b70  df 58 25 2b 33 32 2c 59  25 2d 31 34 0d 02 e4 42  |.X%+32,Y%-14...B|
00000b80  e6 30 2c 63 6f 6c 6f 75  72 3a ec 58 25 2b 33 36  |.0,colour:.X%+36|
00000b90  2c 59 25 2d 33 35 3a ef  73 75 69 74 25 3a ec 58  |,Y%-35:.suit%:.X|
00000ba0  25 2b 39 36 2c 59 25 2d  31 33 30 3a f2 69 6e 76  |%+96,Y%-130:.inv|
00000bb0  28 73 75 69 74 25 29 3a  ef 32 35 35 3a e1 0d 02  |(suit%):.255:...|
00000bc0  ee 0a dd f2 69 6e 69 74  0d 02 f8 29 e3 6e 25 3d  |....init...).n%=|
00000bd0  31 b8 34 3a 41 25 28 6e  25 29 3d 31 3a ed 3a e3  |1.4:A%(n%)=1:.:.|
00000be0  6e 25 3d 31 b8 38 3a 44  25 28 6e 25 29 3d 36 3a  |n%=1.8:D%(n%)=6:|
00000bf0  ed 0d 03 02 21 58 25 3d  35 36 30 3a e3 6e 25 3d  |....!X%=560:.n%=|
00000c00  31 b8 34 3a 59 25 3d 31  32 32 34 2d 32 32 34 2a  |1.4:Y%=1224-224*|
00000c10  6e 25 0d 03 0c 14 43 25  3d 31 3a 53 25 3d 6e 25  |n%....C%=1:S%=n%|
00000c20  3a f2 63 61 72 64 0d 03  16 05 ed 0d 03 20 18 6e  |:.card....... .n|
00000c30  25 3d 31 3a e3 49 25 3d  31 b8 38 3a e3 4a 25 3d  |%=1:.I%=1.8:.J%=|
00000c40  31 b8 36 0d 03 2a 35 43  25 28 49 25 2c 4a 25 29  |1.6..*5C%(I%,J%)|
00000c50  3d 63 25 28 4e 25 28 6e  25 29 29 3a 53 25 28 49  |=c%(N%(n%)):S%(I|
00000c60  25 2c 4a 25 29 3d 73 25  28 4e 25 28 6e 25 29 29  |%,J%)=s%(N%(n%))|
00000c70  3a 6e 25 3d 6e 25 2b 31  0d 03 34 07 ed 3a ed 0d  |:n%=n%+1..4..:..|
00000c80  03 3e 05 e1 0d 03 48 0a  dd f2 64 65 61 6c 0d 03  |.>....H...deal..|
00000c90  52 13 59 25 3d 31 30 30  30 3a e3 49 25 3d 31 b8  |R.Y%=1000:.I%=1.|
00000ca0  38 0d 03 5c 18 e7 49 25  3e 34 20 8c 4b 25 3d 38  |8..\..I%>4 .K%=8|
00000cb0  34 34 20 8b 4b 25 3d 35  36 0d 03 66 1b e3 4a 25  |44 .K%=56..f..J%|
00000cc0  3d 31 b8 36 3a 58 25 3d  4b 25 2b 34 30 2a 28 4a  |=1.6:X%=K%+40*(J|
00000cd0  25 2d 31 29 0d 03 70 1d  43 25 3d 43 25 28 49 25  |%-1)..p.C%=C%(I%|
00000ce0  2c 4a 25 29 3a 53 25 3d  53 25 28 49 25 2c 4a 25  |,J%):S%=S%(I%,J%|
00000cf0  29 0d 03 7a 09 f2 63 61  72 64 0d 03 84 05 ed 0d  |)..z..card......|
00000d00  03 8e 1d e7 49 25 3d 34  20 8c 59 25 3d 31 30 30  |....I%=4 .Y%=100|
00000d10  30 20 8b 59 25 3d 59 25  2d 32 32 34 0d 03 98 05  |0 .Y%=Y%-224....|
00000d20  ed 0d 03 a2 23 ef 32 36  2c 34 3a e3 6e 25 3d 31  |....#.26,4:.n%=1|
00000d30  b8 34 3a f1 8a 31 36 2c  6e 25 2a 37 2d 34 29 3b  |.4:..16,n%*7-4);|
00000d40  6e 25 3a ed 0d 03 ac 2c  e3 6e 25 3d 31 b8 38 3a  |n%:....,.n%=1.8:|
00000d50  e7 6e 25 3e 34 20 8c 78  25 3d 32 35 3a 79 25 3d  |.n%>4 .x%=25:y%=|
00000d60  6e 25 2d 34 20 8b 78 25  3d 30 3a 79 25 3d 6e 25  |n%-4 .x%=0:y%=n%|
00000d70  0d 03 b6 1b f1 8a 78 25  2c 37 2a 79 25 2d 34 29  |......x%,7*y%-4)|
00000d80  bd 28 36 34 2b 6e 25 29  3b 3a ed 0d 03 c0 05 e1  |.(64+n%);:......|
00000d90  0d 03 ca 0b dd f2 65 6e  74 65 72 0d 03 d4 19 f1  |......enter.....|
00000da0  8a 30 2c 31 29 3b 22 44  65 61 6c 20 4e 6f 2e 20  |.0,1);"Deal No. |
00000db0  22 3b 4d 25 0d 03 de 1d  f1 8a 31 38 2c 31 29 3b  |";M%......18,1);|
00000dc0  22 4d 6f 76 65 20 4e 6f  2e 20 22 3b 6d 6f 76 65  |"Move No. ";move|
00000dd0  25 0d 03 e8 19 f1 8a 36  2c 32 29 3b 22 4d 6f 76  |%......6,2);"Mov|
00000de0  65 20 66 72 6f 6d 3f 20  22 3b 0d 03 f2 10 66 6c  |e from? ";....fl|
00000df0  61 67 25 3d a3 3a f2 6b  65 79 0d 03 fc 0d e7 4b  |ag%=.:.key.....K|
00000e00  24 3d 22 55 22 20 e1 0d  04 06 09 63 68 6b 3d b9  |$="U" .....chk=.|
00000e10  0d 04 10 0c 66 72 6f 6d  25 3d 61 25 0d 04 1a 07  |....from%=a%....|
00000e20  f1 4b 24 0d 04 24 18 f1  8a 32 36 2c 32 29 3b 22  |.K$..$...26,2);"|
00000e30  4d 6f 76 65 20 74 6f 3f  20 22 3b 0d 04 2e 10 66  |Move to? ";....f|
00000e40  6c 61 67 25 3d b9 3a f2  6b 65 79 0d 04 38 0a 74  |lag%=.:.key..8.t|
00000e50  6f 25 3d 61 25 0d 04 42  07 f1 4b 24 0d 04 4c 05  |o%=a%..B..K$..L.|
00000e60  e1 0d 04 56 09 dd f2 6b  65 79 0d 04 60 2d e7 66  |...V...key..`-.f|
00000e70  6c 61 67 25 20 41 24 3d  22 41 42 43 44 45 46 47  |lag% A$="ABCDEFG|
00000e80  48 31 32 33 34 22 20 8b  20 41 24 3d 22 41 42 43  |H1234" . A$="ABC|
00000e90  44 45 46 47 48 55 22 0d  04 6a 13 f5 3a 61 25 3d  |DEFGHU"..j..:a%=|
00000ea0  a7 41 24 2c be 29 3a fd  61 25 0d 04 74 10 4b 24  |.A$,.):.a%..t.K$|
00000eb0  3d c1 41 24 2c 61 25 2c  31 29 0d 04 7e 1a e7 4b  |=.A$,a%,1)..~..K|
00000ec0  24 3d 22 55 22 20 63 68  6b 3d a3 3a f2 75 6e 64  |$="U" chk=.:.und|
00000ed0  6f 3a e1 20 0d 04 88 0c  6d 24 3d 6d 24 2b 4b 24  |o:. ....m$=m$+K$|
00000ee0  0d 04 92 17 e7 20 a9 6d  24 3e 31 32 20 6d 24 3d  |..... .m$>12 m$=|
00000ef0  c2 6d 24 2c 31 32 29 0d  04 9c 05 e1 0d 04 a6 11  |.m$,12).........|
00000f00  dd f2 63 68 65 63 6b 3a  6d 76 25 3d b9 0d 04 b0  |..check:mv%=....|
00000f10  18 e7 44 25 28 66 72 6f  6d 25 29 3d 30 20 6d 76  |..D%(from%)=0 mv|
00000f20  25 3d a3 3a e1 0d 04 ba  14 e7 74 6f 25 3c 39 3a  |%=.:......to%<9:|
00000f30  f2 63 68 65 63 6b 32 3a  e1 0d 04 c4 29 e7 53 25  |.check2:....).S%|
00000f40  28 66 72 6f 6d 25 2c 44  25 28 66 72 6f 6d 25 29  |(from%,D%(from%)|
00000f50  29 3c 3e 28 74 6f 25 2d  38 29 20 6d 76 25 3d a3  |)<>(to%-8) mv%=.|
00000f60  3a e1 0d 04 ce 2d e7 43  25 28 66 72 6f 6d 25 2c  |:....-.C%(from%,|
00000f70  44 25 28 66 72 6f 6d 25  29 29 3c 3e 41 25 28 74  |D%(from%))<>A%(t|
00000f80  6f 25 2d 38 29 2b 31 20  6d 76 25 3d a3 3a e1 0d  |o%-8)+1 mv%=.:..|
00000f90  04 d8 05 e1 0d 04 e2 0c  dd f2 63 68 65 63 6b 32  |..........check2|
00000fa0  0d 04 ec 17 e7 44 25 28  74 6f 25 29 3d 31 36 20  |.....D%(to%)=16 |
00000fb0  6d 76 25 3d a3 3a e1 0d  04 f6 16 e7 44 25 28 74  |mv%=.:......D%(t|
00000fc0  6f 25 29 3d 30 20 6d 76  25 3d b9 3a e1 0d 05 00  |o%)=0 mv%=.:....|
00000fd0  33 e7 43 25 28 66 72 6f  6d 25 2c 44 25 28 66 72  |3.C%(from%,D%(fr|
00000fe0  6f 6d 25 29 29 2b 31 3c  3e 43 25 28 74 6f 25 2c  |om%))+1<>C%(to%,|
00000ff0  44 25 28 74 6f 25 29 29  20 6d 76 25 3d a3 3a e1  |D%(to%)) mv%=.:.|
00001000  0d 05 0a 05 e1 0d 05 14  0a dd f2 75 6e 64 6f 0d  |...........undo.|
00001010  05 1e 09 6d 76 25 3d b9  0d 05 28 1c e7 20 a9 28  |...mv%=...(.. .(|
00001020  6d 24 29 3c 3d 30 20 6d  76 25 3d a3 3a 63 68 6b  |m$)<=0 mv%=.:chk|
00001030  3d b9 3a e1 0d 05 32 15  41 24 3d 22 41 42 43 44  |=.:...2.A$="ABCD|
00001040  45 46 47 48 31 32 33 34  22 0d 05 3c 1b 73 24 3d  |EFGH1234"..<.s$=|
00001050  c2 6d 24 2c 32 29 3a 6d  24 3d c0 6d 24 2c a9 6d  |.m$,2):m$=.m$,.m|
00001060  24 2d 32 29 0d 05 46 15  66 72 6f 6d 25 3d a7 41  |$-2)..F.from%=.A|
00001070  24 2c c2 73 24 2c 31 29  29 0d 05 50 13 74 6f 25  |$,.s$,1))..P.to%|
00001080  3d a7 41 24 2c c0 73 24  2c 31 29 29 0d 05 5a 05  |=.A$,.s$,1))..Z.|
00001090  e1 0d 05 64 1d dd f2 69  6e 76 28 4c 25 29 3a 3f  |...d...inv(L%):?|
000010a0  26 35 36 3d 4c 25 3a d6  26 39 30 30 3a e1 0d 05  |&56=L%:.&900:...|
000010b0  6e 0a dd f2 66 72 6f 6d  0d 05 78 12 e7 66 72 6f  |n...from..x..fro|
000010c0  6d 25 3e 38 20 e5 8d 64  7a 45 0d 05 82 33 43 31  |m%>8 ..dzE...3C1|
000010d0  25 3d 43 25 28 66 72 6f  6d 25 2c 44 25 28 66 72  |%=C%(from%,D%(fr|
000010e0  6f 6d 25 29 29 3a 53 31  25 3d 53 25 28 66 72 6f  |om%)):S1%=S%(fro|
000010f0  6d 25 2c 44 25 28 66 72  6f 6d 25 29 29 0d 05 8c  |m%,D%(from%))...|
00001100  2f 43 25 28 66 72 6f 6d  25 2c 44 25 28 66 72 6f  |/C%(from%,D%(fro|
00001110  6d 25 29 29 3d 30 3a 53  25 28 66 72 6f 6d 25 2c  |m%))=0:S%(from%,|
00001120  44 25 28 66 72 6f 6d 25  29 29 3d 30 0d 05 96 1e  |D%(from%))=0....|
00001130  44 25 28 66 72 6f 6d 25  29 3d 44 25 28 66 72 6f  |D%(from%)=D%(fro|
00001140  6d 25 29 2d 31 3a 5a 25  3d 31 0d 05 a0 20 e7 44  |m%)-1:Z%=1... .D|
00001150  25 28 66 72 6f 6d 25 29  3e 36 20 8c 5a 25 3d 44  |%(from%)>6 .Z%=D|
00001160  25 28 66 72 6f 6d 25 29  2d 36 0d 05 aa 44 e7 66  |%(from%)-6...D.f|
00001170  72 6f 6d 25 3e 34 20 4b  25 3d 38 34 34 3a 59 25  |rom%>4 K%=844:Y%|
00001180  3d 31 32 32 34 2d 32 32  34 2a 28 66 72 6f 6d 25  |=1224-224*(from%|
00001190  2d 34 29 20 8b 4b 25 3d  35 36 3a 59 25 3d 31 32  |-4) .K%=56:Y%=12|
000011a0  32 34 2d 32 32 34 2a 28  66 72 6f 6d 25 29 0d 05  |24-224*(from%)..|
000011b0  b4 28 e6 30 2c 31 32 38  3a ef 32 34 2c 4b 25 3b  |.(.0,128:.24,K%;|
000011c0  59 25 2d 31 39 37 3b 4b  25 2b 34 30 30 3b 59 25  |Y%-197;K%+400;Y%|
000011d0  2b 31 30 3b 3a da 0d 05  be 17 e7 20 44 25 28 66  |+10;:...... D%(f|
000011e0  72 6f 6d 25 29 3d 30 20  e5 8d 64 70 45 0d 05 c8  |rom%)=0 ..dpE...|
000011f0  2f 49 25 3d 66 72 6f 6d  25 3a e3 4a 25 3d 5a 25  |/I%=from%:.J%=Z%|
00001200  b8 20 44 25 28 66 72 6f  6d 25 29 3a 58 25 3d 4b  |. D%(from%):X%=K|
00001210  25 2b 34 30 2a 28 4a 25  2d 5a 25 29 0d 05 d2 1d  |%+40*(J%-Z%)....|
00001220  43 25 3d 43 25 28 49 25  2c 4a 25 29 3a 53 25 3d  |C%=C%(I%,J%):S%=|
00001230  53 25 28 49 25 2c 4a 25  29 0d 05 dc 09 f2 63 61  |S%(I%,J%).....ca|
00001240  72 64 0d 05 e6 05 ed 0d  05 f0 05 e1 0d 05 fa 11  |rd..............|
00001250  66 72 6f 6d 25 3d 66 72  6f 6d 25 2d 38 0d 06 04  |from%=from%-8...|
00001260  1b 43 31 25 3d 41 25 28  66 72 6f 6d 25 29 3a 53  |.C1%=A%(from%):S|
00001270  31 25 3d 66 72 6f 6d 25  0d 06 0e 19 41 25 28 66  |1%=from%....A%(f|
00001280  72 6f 6d 25 29 3d 41 25  28 66 72 6f 6d 25 29 2d  |rom%)=A%(from%)-|
00001290  31 0d 06 18 1c 58 25 3d  35 36 30 3a 59 25 3d 31  |1....X%=560:Y%=1|
000012a0  32 32 34 2d 32 32 34 2a  66 72 6f 6d 25 0d 06 22  |224-224*from%.."|
000012b0  19 43 25 3d 41 25 28 66  72 6f 6d 25 29 3a 53 25  |.C%=A%(from%):S%|
000012c0  3d 66 72 6f 6d 25 0d 06  2c 09 f2 63 61 72 64 0d  |=from%..,..card.|
000012d0  06 36 05 e1 0d 06 40 08  dd f2 74 6f 0d 06 4a 10  |.6....@...to..J.|
000012e0  e7 74 6f 25 3e 38 20 e5  8d 74 78 46 0d 06 54 1a  |.to%>8 ..txF..T.|
000012f0  44 25 28 74 6f 25 29 3d  44 25 28 74 6f 25 29 2b  |D%(to%)=D%(to%)+|
00001300  31 3a 5a 25 3d 31 0d 06  5e 1c e7 20 44 25 28 74  |1:Z%=1..^.. D%(t|
00001310  6f 25 29 3e 37 20 5a 25  3d 44 25 28 74 6f 25 29  |o%)>7 Z%=D%(to%)|
00001320  2d 36 0d 06 68 2b 43 25  28 74 6f 25 2c 44 25 28  |-6..h+C%(to%,D%(|
00001330  74 6f 25 29 29 3d 43 31  25 3a 53 25 28 74 6f 25  |to%))=C1%:S%(to%|
00001340  2c 44 25 28 74 6f 25 29  29 3d 53 31 25 0d 06 72  |,D%(to%))=S1%..r|
00001350  3e e7 74 6f 25 3e 34 20  4b 25 3d 38 34 34 3a 59  |>.to%>4 K%=844:Y|
00001360  25 3d 31 32 32 34 2d 32  32 34 2a 28 74 6f 25 2d  |%=1224-224*(to%-|
00001370  34 29 20 8b 4b 25 3d 35  36 3a 59 25 3d 31 32 32  |4) .K%=56:Y%=122|
00001380  34 2d 32 32 34 2a 28 74  6f 25 29 0d 06 7c 28 e6  |4-224*(to%)..|(.|
00001390  30 2c 31 32 38 3a ef 32  34 2c 4b 25 3b 59 25 2d  |0,128:.24,K%;Y%-|
000013a0  31 39 37 3b 4b 25 2b 34  30 30 3b 59 25 2b 31 30  |197;K%+400;Y%+10|
000013b0  3b 3a da 0d 06 86 2c 49  25 3d 74 6f 25 3a e3 4a  |;:....,I%=to%:.J|
000013c0  25 3d 5a 25 20 b8 20 44  25 28 74 6f 25 29 3a 58  |%=Z% . D%(to%):X|
000013d0  25 3d 4b 25 2b 34 30 2a  28 4a 25 2d 5a 25 29 0d  |%=K%+40*(J%-Z%).|
000013e0  06 90 1d 43 25 3d 43 25  28 49 25 2c 4a 25 29 3a  |...C%=C%(I%,J%):|
000013f0  53 25 3d 53 25 28 49 25  2c 4a 25 29 0d 06 9a 09  |S%=S%(I%,J%)....|
00001400  f2 63 61 72 64 0d 06 a4  05 ed 0d 06 ae 05 e1 0d  |.card...........|
00001410  06 b8 0d 74 6f 25 3d 74  6f 25 2d 38 0d 06 c2 15  |...to%=to%-8....|
00001420  41 25 28 74 6f 25 29 3d  41 25 28 74 6f 25 29 2b  |A%(to%)=A%(to%)+|
00001430  31 0d 06 cc 1a 58 25 3d  35 36 30 3a 59 25 3d 31  |1....X%=560:Y%=1|
00001440  32 32 34 2d 32 32 34 2a  74 6f 25 0d 06 d6 15 43  |224-224*to%....C|
00001450  25 3d 41 25 28 74 6f 25  29 3a 53 25 3d 74 6f 25  |%=A%(to%):S%=to%|
00001460  0d 06 e0 09 f2 63 61 72  64 0d 06 ea 05 e1 0d 06  |.....card.......|
00001470  f4 52 2a 4b 2e 30 20 2a  54 2e 7c 4d 46 4f 52 49  |.R*K.0 *T.|MFORI|
00001480  25 3d 30 54 4f 20 54 4f  50 2d 50 41 47 45 20 53  |%=0TO TOP-PAGE S|
00001490  54 45 50 34 3a 49 25 21  26 45 30 30 3d 49 25 21  |TEP4:I%!&E00=I%!|
000014a0  50 41 47 45 3a 4e 45 58  54 7c 4d 50 41 47 45 3d  |PAGE:NEXT|MPAGE=|
000014b0  26 45 30 30 7c 4d 4f 4c  44 7c 4d 52 55 4e 7c 4d  |&E00|MOLD|MRUN|M|
000014c0  0d 06 fe 10 2a 46 58 31  33 38 2c 30 2c 31 32 38  |....*FX138,0,128|
000014d0  0d 07 08 05 e0 0d 07 12  18 dd f2 77 69 6e 3a ef  |...........win:.|
000014e0  32 33 2c 31 2c 30 3b 30  3b 30 3b 30 3b 0d 07 1c  |23,1,0;0;0;0;...|
000014f0  1e f1 8a 31 31 2c 34 29  22 43 4f 4e 47 52 41 54  |...11,4)"CONGRAT|
00001500  55 4c 41 54 49 4f 4e 53  21 21 22 0d 07 26 1e f1  |ULATIONS!!"..&..|
00001510  8a 31 31 2c 35 29 22 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.11,5)"---------|
00001520  2d 2d 2d 2d 2d 2d 2d 2d  22 0d 07 30 2b f1 8a 34  |--------"..0+..4|
00001530  2c 38 29 22 59 6f 75 20  68 61 76 65 20 63 6f 6d  |,8)"You have com|
00001540  70 6c 65 74 65 64 20 44  65 61 6c 20 6e 6f 2e 20  |pleted Deal no. |
00001550  22 3b 4d 25 0d 07 3a 20  f1 8a 31 33 2c 31 30 29  |";M%..: ..13,10)|
00001560  22 69 6e 20 22 3b 6d 6f  76 65 25 3b 22 20 6d 6f  |"in ";move%;" mo|
00001570  76 65 73 22 0d 07 44 22  f1 8a 31 30 2c 31 34 29  |ves"..D"..10,14)|
00001580  22 41 6e 6f 74 68 65 72  20 64 65 61 6c 3f 20 20  |"Another deal?  |
00001590  28 59 2f 4e 29 22 0d 07  4e 1b f5 3a 4b 24 3d bf  |(Y/N)"..N..:K$=.|
000015a0  30 3a fd 4b 24 3d 22 59  22 20 84 4b 24 3d 22 4e  |0:.K$="Y" .K$="N|
000015b0  22 0d 07 58 0d 6d 6f 76  65 25 3d 30 3a e1 0d ff  |"..X.move%=0:...|
000015c0
G/CASTLE2.m0
G/CASTLE2.m1
G/CASTLE2.m2
G/CASTLE2.m4
G/CASTLE2.m5