Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_52.ADF » G/CASTLE

G/CASTLE

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_52.ADF
Filename: G/CASTLE
Read OK:
File size: 1566 bytes
Load address: FFFF1D00
Exec address: FFFF802B
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM ******************
   20REM Beleaguered Castle
   30REM By R.A.Dimond
   40REM (c) October 1992
   50REM Version 4, June 00
   60REM ******************
   70ONERROR IF ERR=17 RUN ELSE MODE6:REPORT:PRINT" at line ";ERL:END
   80*FX21,0
   90IF PAGE>&E00 COLOUR0:GOTO1980
  100MODE1:VDU23;8202;0;0;0;
  110VDU19,0,4;0;19,2,0;0;
  120PROCvars
  130PROCrandom
  140PROCinit
  150PROCdeal
  160REPEAT:VDU26,4
  170PROCenter
  180IFINKEY-74 GOTO240
  190PROCcheck
  200IFmv%=FALSE THEN VDU7:m$=LEFT$(m$,LENm$-2):PRINTTAB(10,30)"You can't move there!";:TIME=0:REPEATUNTILTIME>300:PRINTTAB(4,30)SPC35:OSCLI"FX15":GOTO170
  210move%=move%+1:PROCfrom:PROCto
  220IFA%(1)=13 ANDA%(2)=13 ANDA%(3)=13 ANDA%(4)=13 THENwin%=TRUE
  230UNTILINKEY-74 ORwin%=TRUE
  240IFwin%=TRUE THEN TIME=0:REPEATUNTILTIME=500:MODE6:PROCwin
  250UNTIL0 ORK$="N"
  260END
  270:
  280DEFPROCtitle
  290PRINTTAB(10,1)"BELEAGUERED CASTLE"
  300PRINTTAB(10,2)STRING$(18,"~")
  310ENDPROC
  320:
  330DEFPROCvars
  340DIM N%(48),c%(48),s%(48),C%(8,16),S%(8,16),A%(4),D%(8)
  350m$="":move%=0:win%=FALSE
  360ENDPROC
  370:
  380DEFPROCrandom
  390*FX15
  400PROCtitle
  410PRINTTAB(0,6)"Enter Deal No. "''"or press RETURN"'"for a random deal"
  420INPUTTAB(15,6)M%
  430IFM%=0 M%=ABS(RND(-TIME))
  440G=RND(-M%)
  450FORI%=1TO48:N%(I%)=I%:NEXT:FORI%=48 TO2STEP-1:D%=RND(I%):T%=N%(D%):N%(D%)=N%(I%):N%(I%)=T%:NEXTI%
  460RESTORE:FORi%=1TO48:READc%(i%),s%(i%):NEXT
  470CLS
  480ENDPROC
  490DATA8,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
  500DATA10,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
  510:
  520DEFPROCinit
  530PROCtitle
  540PRINTTAB(12,3)"Deal No. ";M%
  550FORn%=1TO4:A%(n%)=1:NEXT:FORn%=1TO8:D%(n%)=6:NEXT
  560VDU5:X%=560:FORn%=1TO4:Y%=848-160*n%
  570C%=1:S%=n%:PROCcard(C%,S%)
  580NEXT
  590n%=1:FORI%=1TO8:FORJ%=1TO6
  600C%(I%,J%)=c%(N%(n%)):S%(I%,J%)=s%(N%(n%)):n%=n%+1
  610NEXT:NEXT
  620ENDPROC
  630:
  640DEFPROCfive
  650PRINT;CHR$241;CHR$8;CHR$10;CHR$240;CHR$8;CHR$10;
  660ENDPROC
  670:
  680DEFPROCcard(card%,suit%)
  690VDU5
  700IF(suit%=1 ORsuit%=3) col%=1 ELSEIF(suit%=2 ORsuit%=4) col%=2
  710suit%=suit%+223
  720VDU24,X%-4;Y%-4;X%+100;Y%+132;:GCOL0,131:CLG
  730GCOL0,2:MOVEX%-4,Y%-4:DRAWX%-4,Y%+132:DRAWX%+100,Y%+132:DRAWX%+100,Y%-4:DRAWX%-4,Y%-4
  740IFcard%=1 cd%=65
  750IFcard%=11 cd%=ASC"J"
  760IFcard%=12 cd%=ASC"Q"
  770IFcard%=13 cd%=ASC"K"
  780IFcard%>1 ANDcard%<10 cd%=card%+48
  790IFcard%=10 cd%=229
  800PROCp
  810PROCpp
  820ENDPROC
  830:
  840DEFPROCp
  850MOVEX%,Y%+28:GCOL0,col%:PRINT;CHR$suit%:MOVEX%,Y%+128:PRINT;CHR$cd%
  860MOVEX%+64,Y%+28:PRINT;CHR$cd%:MOVEX%+64,Y%+128:PRINT;CHR$suit%
  870ENDPROC
  880:
  890DEFPROCpp
  900IFcard%=1 MOVEX%+32,Y%+80:PRINT;CHR$suit%:ENDPROC
  910IFcard%=2 MOVEX%+32,Y%+120:PRINT;CHR$239;:MOVEX%+32,Y%+56:PRINT;CHR$239:ENDPROC
  920IFcard%=3 MOVEX%+32,Y%+120:PRINT;CHR$239;:MOVEX%+32,Y%+88:PRINT;CHR$239;:MOVEX%+32,Y%+56:PRINT;CHR$239:ENDPROC
  930IFcard%=4 MOVEX%+32,Y%+104:PRINT;CHR$240;:MOVEX%+32,Y%+40:PRINT;CHR$240:ENDPROC
  940IFcard%=5 MOVEX%+32,Y%+104:PRINT;CHR$240;:MOVEX%+32,Y%+88:PRINT;CHR$239;:MOVEX%+32,Y%+40:PRINT;CHR$240:ENDPROC
  950IFcard%=6 MOVEX%+32,Y%+104:PRINT;CHR$240;:MOVEX%+32,Y%+72:PRINT;CHR$240;:MOVEX%+32,Y%+40:PRINT;CHR$240:ENDPROC
  960IFcard%=7 MOVEX%+32,Y%+104:PROCfive:MOVEX%+32,Y%+40:PRINT;CHR$240:ENDPROC
  970IFcard%=8 MOVEX%+32,Y%+104:PRINT;CHR$241;:MOVEX%+32,Y%+72:PROCfive:ENDPROC
  980IFcard%=9 MOVEX%+32,Y%+112:PRINT;CHR$240;:MOVEX%+32,Y%+88:PROCfive:MOVEX%+32,Y%+32:PRINT;CHR$240:ENDPROC
  990IFcard%=10 MOVEX%+32,Y%+112:PROCfive:MOVEX%+32,Y%+66:PROCfive:ENDPROC
 1000IFcard%=11 C$=CHR$242 ELSEIFcard%=12 C$=CHR$243 ELSEIFcard%=13 C$=CHR$244
 1010IFcard%=11 D$=CHR$248+CHR$249+CHR$252 ELSEIFcard%=12 D$=CHR$248+CHR$250+CHR$252 ELSEIFcard%=13 D$=CHR$248+CHR$251+CHR$252
 1020MOVEX%+32,Y%+128:PRINTC$
 1030MOVEX%,Y%+96:PRINTCHR$245+CHR$246+CHR$247
 1040GCOL0,0:MOVEX%,Y%+64:PRINTD$:GCOL0,col%
 1050MOVEX%+32,Y%+32:PRINTCHR$253:ENDPROC
 1060:
 1070DEFPROCdeal
 1080Y%=688:FORI%=1TO8
 1090IFI%>4 THENK%=848 ELSEK%=80
 1100FORJ%=1TO6:X%=K%+40*(J%-1)
 1110C%=C%(I%,J%):S%=S%(I%,J%)
 1120PROCcard(C%,S%)
 1130NEXT
 1140IFI%=4 THENY%=688 ELSEY%=Y%-160
 1150NEXT
 1160VDU4:FORn%=1TO4:PRINTTAB(16,n%*5+3);n%:NEXT
 1170FORn%=1TO8:IFn%>4 THENx%=25:y%=n%-4 ELSEx%=1:y%=n%
 1180PRINTTAB(x%,5*y%+3)CHR$(64+n%);:NEXT
 1190ENDPROC
 1200:
 1210DEFPROCenter
 1220PRINTTAB(14,28);"Move No. ";move%
 1230PRINTTAB(6,30);"Move from? ";
 1240flag%=FALSE:PROCkey
 1250IFK$="U" ENDPROC
 1260chk=TRUE
 1270from%=a%
 1280PRINTK$
 1290PRINTTAB(26,30);"Move to? ";
 1300flag%=TRUE:PROCkey
 1310to%=a%
 1320PRINTK$
 1330FORz%=1TO100:NEXT:PRINTTAB(4,30);SPC35
 1340ENDPROC
 1350:
 1360DEFPROCkey
 1370IFflag% A$="ABCDEFGH1234" ELSE A$="ABCDEFGHU"
 1380REPEAT:a%=INSTR(A$,GET$):UNTILa%
 1390K$=MID$(A$,a%,1)
 1400IFK$="U" chk=FALSE:PROCundo:ENDPROC 
 1410m$=m$+K$
 1420ENDPROC
 1430:
 1440DEFPROCcheck:mv%=TRUE
 1450IFD%(from%)=0 mv%=FALSE:ENDPROC
 1460IFto%<9:PROCcheck2:ENDPROC
 1470IFS%(from%,D%(from%))<>(to%-8) mv%=FALSE:ENDPROC
 1480IFC%(from%,D%(from%))<>A%(to%-8)+1 mv%=FALSE:ENDPROC
 1490ENDPROC
 1500:
 1510DEFPROCcheck2
 1520IFD%(to%)=16 mv%=FALSE:ENDPROC
 1530IFD%(to%)=0 mv%=TRUE:ENDPROC
 1540IFC%(from%,D%(from%))+1<>C%(to%,D%(to%)) mv%=FALSE:ENDPROC
 1550ENDPROC
 1560:
 1570DEFPROCfrom
 1580IFfrom%>8 GOTO1710
 1590C1%=C%(from%,D%(from%)):S1%=S%(from%,D%(from%))
 1600C%(from%,D%(from%))=0:S%(from%,D%(from%))=0
 1610D%(from%)=D%(from%)-1:Z%=1
 1620IFD%(from%)>6 THENZ%=D%(from%)-6
 1630IFfrom%>4 K%=848:Y%=848-160*(from%-4) ELSEK%=80:Y%=848-160*(from%)
 1640GCOL0,128:VDU24,K%-8;Y%-8;K%+400;Y%+150;:CLG
 1650IF D%(from%)=0 GOTO1700
 1660I%=from%:FORJ%=Z%TO D%(from%):X%=K%+40*(J%-Z%)
 1670C%=C%(I%,J%):S%=S%(I%,J%)
 1680PROCcard(C%,S%)
 1690NEXT
 1700ENDPROC
 1710from%=from%-8
 1720C1%=A%(from%):S1%=from%
 1730A%(from%)=A%(from%)-1
 1740X%=560:Y%=848-160*from%
 1750C%=A%(from%):S%=from%
 1760PROCcard(C%,S%)
 1770ENDPROC
 1780:
 1790DEFPROCto
 1800IFto%>8 GOTO1910
 1810D%(to%)=D%(to%)+1:Z%=1
 1820IF D%(to%)>7 Z%=D%(to%)-6
 1830C%(to%,D%(to%))=C1%:S%(to%,D%(to%))=S1%
 1840IFto%>4 K%=848:Y%=848-160*(to%-4) ELSEK%=80:Y%=848-160*(to%)
 1850GCOL0,128:VDU24,K%-8;Y%-8;K%+400;Y%+150;:CLG
 1860I%=to%:FORJ%=Z% TO D%(to%):X%=K%+40*(J%-Z%)
 1870C%=C%(I%,J%):S%=S%(I%,J%)
 1880PROCcard(C%,S%)
 1890NEXT
 1900ENDPROC
 1910to%=to%-8
 1920A%(to%)=A%(to%)+1
 1930X%=560:Y%=848-160*to%
 1940C%=A%(to%):S%=to%
 1950PROCcard(C%,S%)
 1960ENDPROC
 1970:
 1980*K.0 *T.|MFORI%=0TO TOP-PAGE STEP4:I%!&E00=I%!PAGE:NEXT|MPAGE=&E00|MOLD|MRUN|M
 1990*FX138,0,128
 2000END
 2010:
 2020DEFPROCwin:VDU23,1,0;0;0;0;
 2030PRINTTAB(11,4)"CONGRATULATIONS!!"
 2040PRINTTAB(11,5)"-----------------"
 2050PRINTTAB(4,8)"You have completed Deal no. ";M%
 2060PRINTTAB(13,10)"in ";move%;" moves"
 2070PRINTTAB(10,14)"Another deal?  (Y/N)"
 2080REPEAT:K$=INKEY$0:UNTILK$="Y" ORK$="N"
 2090move%=0:ENDPROC
 2100:
 2110DEFPROCundo
 2120mv%=TRUE
 2130IF LEN(m$)<=0 mv%=FALSE:chk=TRUE:ENDPROC
 2140:
 2150A$="ABCDEFGH1234"
 2160s$=RIGHT$(m$,2):m$=LEFT$(m$,LENm$-2)
 2170from%=INSTR(A$,RIGHT$(s$,1))
 2180IFfrom%>8 GOTO1720
 2190to%=INSTR(A$,LEFT$(s$,1))
 2200ENDPROC
 2210from%=from%-8
 2220C1%=A%(from%):S1%=from%
 2230A%(from%)=A%(from%)-1
 2240X%=560:Y%=848-160*from%
 2250C%=A%(from%):S%=from%
 2260PROCcard(C%,S%)
 2270ENDPROC
 2280:

� ******************
� Beleaguered Castle
� By R.A.Dimond
(� (c) October 1992
2� Version 4, June 00
<� ******************
F'� � �=17 � � �6:�:�" at line ";�:�
P*FX21,0
Z� �>&E00 �0:�t|G
d�1:�23;8202;0;0;0;
n�19,0,4;0;19,2,0;0;
x	�vars
��random
�	�init
�	�deal
��:�26,4
�
�enter
��-74 �dp@
�
�check
�c�mv%=� � �7:m$=�m$,�m$-2):�10,30)"You can't move there!";:�=0:���>300:�4,30)�35:�"FX15":�tj@
�move%=move%+1:�from:�to
�3�A%(1)=13 �A%(2)=13 �A%(3)=13 �A%(4)=13 �win%=�
���-74 �win%=�
�!�win%=� � �=0:���=500:�6:�win
��0 �K$="N"
�
:
��title
"�10,1)"BELEAGUERED CASTLE"
,�10,2)�18,"~")
6�
@:
J
��vars
T8� N%(48),c%(48),s%(48),C%(8,16),S%(8,16),A%(4),D%(8)
^m$="":move%=0:win%=�
h�
r:
|��random
�	*FX15
�
�title
�B�0,6)"Enter Deal No. "''"or press RETURN"'"for a random deal"
�
�15,6)M%
��M%=0 M%=�(�(-�))
�G=�(-M%)
�T�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%):�
��
��
�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
�l�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
�:

��init

�title
�12,3)"Deal No. ";M%
&)�n%=1�4:A%(n%)=1:�:�n%=1�8:D%(n%)=6:�
0#�5:X%=560:�n%=1�4:Y%=848-160*n%
:C%=1:S%=n%:�card(C%,S%)
D�
Nn%=1:�I%=1�8:�J%=1�6
X5C%(I%,J%)=c%(N%(n%)):S%(I%,J%)=s%(N%(n%)):n%=n%+1
b�:�
l�
v:
�
��five
��;�241;�8;�10;�240;�8;�10;
��
�:
���card(card%,suit%)
��5
�:�(suit%=1 �suit%=3) col%=1 ��(suit%=2 �suit%=4) col%=2
�suit%=suit%+223
�)�24,X%-4;Y%-4;X%+100;Y%+132;:�0,131:�
�G�0,2:�X%-4,Y%-4:�X%-4,Y%+132:�X%+100,Y%+132:�X%+100,Y%-4:�X%-4,Y%-4
��card%=1 cd%=65
��card%=11 cd%=�"J"
��card%=12 cd%=�"Q"
�card%=13 cd%=�"K"
#�card%>1 �card%<10 cd%=card%+48
�card%=10 cd%=229
 �p
*�pp
4�
>:
H��p
R0�X%,Y%+28:�0,col%:�;�suit%:�X%,Y%+128:�;�cd%
\.�X%+64,Y%+28:�;�cd%:�X%+64,Y%+128:�;�suit%
f�
p:
z��pp
�$�card%=1 �X%+32,Y%+80:�;�suit%:�
�8�card%=2 �X%+32,Y%+120:�;�239;:�X%+32,Y%+56:�;�239:�
�M�card%=3 �X%+32,Y%+120:�;�239;:�X%+32,Y%+88:�;�239;:�X%+32,Y%+56:�;�239:�
�8�card%=4 �X%+32,Y%+104:�;�240;:�X%+32,Y%+40:�;�240:�
�M�card%=5 �X%+32,Y%+104:�;�240;:�X%+32,Y%+88:�;�239;:�X%+32,Y%+40:�;�240:�
�M�card%=6 �X%+32,Y%+104:�;�240;:�X%+32,Y%+72:�;�240;:�X%+32,Y%+40:�;�240:�
�6�card%=7 �X%+32,Y%+104:�five:�X%+32,Y%+40:�;�240:�
�7�card%=8 �X%+32,Y%+104:�;�241;:�X%+32,Y%+72:�five:�
�K�card%=9 �X%+32,Y%+112:�;�240;:�X%+32,Y%+88:�five:�X%+32,Y%+32:�;�240:�
�6�card%=10 �X%+32,Y%+112:�five:�X%+32,Y%+66:�five:�
�;�card%=11 C$=�242 ��card%=12 C$=�243 ��card%=13 C$=�244
�Y�card%=11 D$=�248+�249+�252 ��card%=12 D$=�248+�250+�252 ��card%=13 D$=�248+�251+�252
��X%+32,Y%+128:�C$
�X%,Y%+96:�245+�246+�247
�0,0:�X%,Y%+64:�D$:�0,col%
�X%+32,Y%+32:�253:�
$:
.
��deal
8Y%=688:�I%=1�8
B�I%>4 �K%=848 �K%=80
L�J%=1�6:X%=K%+40*(J%-1)
VC%=C%(I%,J%):S%=S%(I%,J%)
`�card(C%,S%)
j�
t�I%=4 �Y%=688 �Y%=Y%-160
~�
� �4:�n%=1�4:�16,n%*5+3);n%:�
�,�n%=1�8:�n%>4 �x%=25:y%=n%-4 �x%=1:y%=n%
��x%,5*y%+3)�(64+n%);:�
��
�:
���enter
��14,28);"Move No. ";move%
��6,30);"Move from? ";
�flag%=�:�key
�
�K$="U" �
�	chk=�
�from%=a%
�K$

�26,30);"Move to? ";
flag%=�:�key

to%=a%
(�K$
2�z%=1�100:�:�4,30);�35
<�
F:
P	��key
Z-�flag% A$="ABCDEFGH1234" � A$="ABCDEFGHU"
d�:a%=�A$,�):�a%
nK$=�A$,a%,1)
x�K$="U" chk=�:�undo:� 
�m$=m$+K$
��
�:
���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%=�:�
�
:
"
��from
,�from%>8 �tnF
63C1%=C%(from%,D%(from%)):S1%=S%(from%,D%(from%))
@/C%(from%,D%(from%))=0:S%(from%,D%(from%))=0
JD%(from%)=D%(from%)-1:Z%=1
T �D%(from%)>6 �Z%=D%(from%)-6
^B�from%>4 K%=848:Y%=848-160*(from%-4) �K%=80:Y%=848-160*(from%)
h)�0,128:�24,K%-8;Y%-8;K%+400;Y%+150;:�
r� D%(from%)=0 �tdF
|/I%=from%:�J%=Z%� D%(from%):X%=K%+40*(J%-Z%)
�C%=C%(I%,J%):S%=S%(I%,J%)
��card(C%,S%)
��
��
�from%=from%-8
�C1%=A%(from%):S1%=from%
�A%(from%)=A%(from%)-1
�X%=560:Y%=848-160*from%
�C%=A%(from%):S%=from%
��card(C%,S%)
��
�:
���to
�to%>8 �DvG
D%(to%)=D%(to%)+1:Z%=1
� D%(to%)>7 Z%=D%(to%)-6
&+C%(to%,D%(to%))=C1%:S%(to%,D%(to%))=S1%
0<�to%>4 K%=848:Y%=848-160*(to%-4) �K%=80:Y%=848-160*(to%)
:)�0,128:�24,K%-8;Y%-8;K%+400;Y%+150;:�
D,I%=to%:�J%=Z% � D%(to%):X%=K%+40*(J%-Z%)
NC%=C%(I%,J%):S%=S%(I%,J%)
X�card(C%,S%)
b�
l�
v
to%=to%-8
�A%(to%)=A%(to%)+1
�X%=560:Y%=848-160*to%
�C%=A%(to%):S%=to%
��card(C%,S%)
��
�:
�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)"-----------------"
+�4,8)"You have completed Deal no. ";M%
 �13,10)"in ";move%;" moves"
"�10,14)"Another deal?  (Y/N)"
 �:K$=�0:�K$="Y" �K$="N"
*
move%=0:�
4:
>
��undo
H	mv%=�
R� �(m$)<=0 mv%=�:chk=�:�
\:
fA$="ABCDEFGH1234"
ps$=�m$,2):m$=�m$,�m$-2)
zfrom%=�A$,�s$,1))
��from%>8 �txF
�to%=�A$,�s$,1))
��
�from%=from%-8
�C1%=A%(from%):S1%=from%
�A%(from%)=A%(from%)-1
�X%=560:Y%=848-160*from%
�C%=A%(from%):S%=from%
��card(C%,S%)
��
�:
�
00000000  0d 00 0a 18 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..... **********|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  0d 00 14 18 f4 20 42 65  |********..... Be|
00000020  6c 65 61 67 75 65 72 65  64 20 43 61 73 74 6c 65  |leaguered Castle|
00000030  0d 00 1e 13 f4 20 42 79  20 52 2e 41 2e 44 69 6d  |..... By R.A.Dim|
00000040  6f 6e 64 0d 00 28 16 f4  20 28 63 29 20 4f 63 74  |ond..(.. (c) Oct|
00000050  6f 62 65 72 20 31 39 39  32 0d 00 32 18 f4 20 56  |ober 1992..2.. V|
00000060  65 72 73 69 6f 6e 20 34  2c 20 4a 75 6e 65 20 30  |ersion 4, June 0|
00000070  30 0d 00 3c 18 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |0..<.. *********|
00000080  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 00 46 27 ee 85 20  |*********..F'.. |
00000090  e7 20 9f 3d 31 37 20 f9  20 8b 20 eb 36 3a f6 3a  |. .=17 . . .6:.:|
000000a0  f1 22 20 61 74 20 6c 69  6e 65 20 22 3b 9e 3a e0  |." at line ";.:.|
000000b0  0d 00 50 0b 2a 46 58 32  31 2c 30 0d 00 5a 15 e7  |..P.*FX21,0..Z..|
000000c0  20 90 3e 26 45 30 30 20  fb 30 3a e5 8d 74 7c 47  | .>&E00 .0:..t|G|
000000d0  0d 00 64 16 eb 31 3a ef  32 33 3b 38 32 30 32 3b  |..d..1:.23;8202;|
000000e0  30 3b 30 3b 30 3b 0d 00  6e 17 ef 31 39 2c 30 2c  |0;0;0;..n..19,0,|
000000f0  34 3b 30 3b 31 39 2c 32  2c 30 3b 30 3b 0d 00 78  |4;0;19,2,0;0;..x|
00000100  09 f2 76 61 72 73 0d 00  82 0b f2 72 61 6e 64 6f  |..vars.....rando|
00000110  6d 0d 00 8c 09 f2 69 6e  69 74 0d 00 96 09 f2 64  |m.....init.....d|
00000120  65 61 6c 0d 00 a0 0b f5  3a ef 32 36 2c 34 0d 00  |eal.....:.26,4..|
00000130  aa 0a f2 65 6e 74 65 72  0d 00 b4 0f e7 a6 2d 37  |...enter......-7|
00000140  34 20 e5 8d 64 70 40 0d  00 be 0a f2 63 68 65 63  |4 ..dp@.....chec|
00000150  6b 0d 00 c8 63 e7 6d 76  25 3d a3 20 8c 20 ef 37  |k...c.mv%=. . .7|
00000160  3a 6d 24 3d c0 6d 24 2c  a9 6d 24 2d 32 29 3a f1  |:m$=.m$,.m$-2):.|
00000170  8a 31 30 2c 33 30 29 22  59 6f 75 20 63 61 6e 27  |.10,30)"You can'|
00000180  74 20 6d 6f 76 65 20 74  68 65 72 65 21 22 3b 3a  |t move there!";:|
00000190  d1 3d 30 3a f5 fd 91 3e  33 30 30 3a f1 8a 34 2c  |.=0:...>300:..4,|
000001a0  33 30 29 89 33 35 3a ff  22 46 58 31 35 22 3a e5  |30).35:."FX15":.|
000001b0  8d 74 6a 40 0d 00 d2 1b  6d 6f 76 65 25 3d 6d 6f  |.tj@....move%=mo|
000001c0  76 65 25 2b 31 3a f2 66  72 6f 6d 3a f2 74 6f 0d  |ve%+1:.from:.to.|
000001d0  00 dc 33 e7 41 25 28 31  29 3d 31 33 20 80 41 25  |..3.A%(1)=13 .A%|
000001e0  28 32 29 3d 31 33 20 80  41 25 28 33 29 3d 31 33  |(2)=13 .A%(3)=13|
000001f0  20 80 41 25 28 34 29 3d  31 33 20 8c 77 69 6e 25  | .A%(4)=13 .win%|
00000200  3d b9 0d 00 e6 11 fd a6  2d 37 34 20 84 77 69 6e  |=.......-74 .win|
00000210  25 3d b9 0d 00 f0 21 e7  77 69 6e 25 3d b9 20 8c  |%=....!.win%=. .|
00000220  20 d1 3d 30 3a f5 fd 91  3d 35 30 30 3a eb 36 3a  | .=0:...=500:.6:|
00000230  f2 77 69 6e 0d 00 fa 0e  fd 30 20 84 4b 24 3d 22  |.win.....0 .K$="|
00000240  4e 22 0d 01 04 05 e0 0d  01 0e 05 3a 0d 01 18 0b  |N".........:....|
00000250  dd f2 74 69 74 6c 65 0d  01 22 1f f1 8a 31 30 2c  |..title.."...10,|
00000260  31 29 22 42 45 4c 45 41  47 55 45 52 45 44 20 43  |1)"BELEAGUERED C|
00000270  41 53 54 4c 45 22 0d 01  2c 13 f1 8a 31 30 2c 32  |ASTLE"..,...10,2|
00000280  29 c4 31 38 2c 22 7e 22  29 0d 01 36 05 e1 0d 01  |).18,"~")..6....|
00000290  40 05 3a 0d 01 4a 0a dd  f2 76 61 72 73 0d 01 54  |@.:..J...vars..T|
000002a0  38 de 20 4e 25 28 34 38  29 2c 63 25 28 34 38 29  |8. N%(48),c%(48)|
000002b0  2c 73 25 28 34 38 29 2c  43 25 28 38 2c 31 36 29  |,s%(48),C%(8,16)|
000002c0  2c 53 25 28 38 2c 31 36  29 2c 41 25 28 34 29 2c  |,S%(8,16),A%(4),|
000002d0  44 25 28 38 29 0d 01 5e  18 6d 24 3d 22 22 3a 6d  |D%(8)..^.m$="":m|
000002e0  6f 76 65 25 3d 30 3a 77  69 6e 25 3d a3 0d 01 68  |ove%=0:win%=...h|
000002f0  05 e1 0d 01 72 05 3a 0d  01 7c 0c dd f2 72 61 6e  |....r.:..|...ran|
00000300  64 6f 6d 0d 01 86 09 2a  46 58 31 35 0d 01 90 0a  |dom....*FX15....|
00000310  f2 74 69 74 6c 65 0d 01  9a 42 f1 8a 30 2c 36 29  |.title...B..0,6)|
00000320  22 45 6e 74 65 72 20 44  65 61 6c 20 4e 6f 2e 20  |"Enter Deal No. |
00000330  22 27 27 22 6f 72 20 70  72 65 73 73 20 52 45 54  |"''"or press RET|
00000340  55 52 4e 22 27 22 66 6f  72 20 61 20 72 61 6e 64  |URN"'"for a rand|
00000350  6f 6d 20 64 65 61 6c 22  0d 01 a4 0d e8 8a 31 35  |om deal"......15|
00000360  2c 36 29 4d 25 0d 01 ae  15 e7 4d 25 3d 30 20 4d  |,6)M%.....M%=0 M|
00000370  25 3d 94 28 b3 28 2d 91  29 29 0d 01 b8 0c 47 3d  |%=.(.(-.))....G=|
00000380  b3 28 2d 4d 25 29 0d 01  c2 54 e3 49 25 3d 31 b8  |.(-M%)...T.I%=1.|
00000390  34 38 3a 4e 25 28 49 25  29 3d 49 25 3a ed 3a e3  |48:N%(I%)=I%:.:.|
000003a0  49 25 3d 34 38 20 b8 32  88 2d 31 3a 44 25 3d b3  |I%=48 .2.-1:D%=.|
000003b0  28 49 25 29 3a 54 25 3d  4e 25 28 44 25 29 3a 4e  |(I%):T%=N%(D%):N|
000003c0  25 28 44 25 29 3d 4e 25  28 49 25 29 3a 4e 25 28  |%(D%)=N%(I%):N%(|
000003d0  49 25 29 3d 54 25 3a ed  49 25 0d 01 cc 1f f7 3a  |I%)=T%:.I%.....:|
000003e0  e3 69 25 3d 31 b8 34 38  3a f3 63 25 28 69 25 29  |.i%=1.48:.c%(i%)|
000003f0  2c 73 25 28 69 25 29 3a  ed 0d 01 d6 05 db 0d 01  |,s%(i%):........|
00000400  e0 05 e1 0d 01 ea 6c dc  38 2c 31 2c 33 2c 32 2c  |......l.8,1,3,2,|
00000410  31 31 2c 34 2c 31 32 2c  31 2c 34 2c 32 2c 39 2c  |11,4,12,1,4,2,9,|
00000420  31 2c 36 2c 32 2c 32 2c  33 2c 37 2c 33 2c 31 30  |1,6,2,2,3,7,3,10|
00000430  2c 33 2c 35 2c 32 2c 31  33 2c 32 2c 35 2c 31 2c  |,3,5,2,13,2,5,1,|
00000440  32 2c 34 2c 31 30 2c 32  2c 38 2c 32 2c 36 2c 31  |2,4,10,2,8,2,6,1|
00000450  2c 33 2c 31 2c 39 2c 34  2c 31 31 2c 33 2c 37 2c  |,3,1,9,4,11,3,7,|
00000460  32 2c 31 33 2c 34 2c 34  2c 33 2c 31 32 2c 32 0d  |2,13,4,4,3,12,2.|
00000470  01 f4 6c dc 31 30 2c 31  2c 31 32 2c 34 2c 34 2c  |..l.10,1,12,4,4,|
00000480  31 2c 31 33 2c 31 2c 38  2c 33 2c 32 2c 31 2c 37  |1,13,1,8,3,2,1,7|
00000490  2c 31 2c 31 31 2c 32 2c  33 2c 34 2c 39 2c 32 2c  |,1,11,2,3,4,9,2,|
000004a0  36 2c 34 2c 31 33 2c 33  2c 37 2c 34 2c 32 2c 32  |6,4,13,3,7,4,2,2|
000004b0  2c 31 31 2c 31 2c 35 2c  33 2c 39 2c 33 2c 36 2c  |,11,1,5,3,9,3,6,|
000004c0  33 2c 34 2c 34 2c 31 30  2c 34 2c 33 2c 33 2c 38  |3,4,4,10,4,3,3,8|
000004d0  2c 34 2c 35 2c 34 2c 31  32 2c 33 0d 01 fe 05 3a  |,4,5,4,12,3....:|
000004e0  0d 02 08 0a dd f2 69 6e  69 74 0d 02 12 0a f2 74  |......init.....t|
000004f0  69 74 6c 65 0d 02 1c 19  f1 8a 31 32 2c 33 29 22  |itle......12,3)"|
00000500  44 65 61 6c 20 4e 6f 2e  20 22 3b 4d 25 0d 02 26  |Deal No. ";M%..&|
00000510  29 e3 6e 25 3d 31 b8 34  3a 41 25 28 6e 25 29 3d  |).n%=1.4:A%(n%)=|
00000520  31 3a ed 3a e3 6e 25 3d  31 b8 38 3a 44 25 28 6e  |1:.:.n%=1.8:D%(n|
00000530  25 29 3d 36 3a ed 0d 02  30 23 ef 35 3a 58 25 3d  |%)=6:...0#.5:X%=|
00000540  35 36 30 3a e3 6e 25 3d  31 b8 34 3a 59 25 3d 38  |560:.n%=1.4:Y%=8|
00000550  34 38 2d 31 36 30 2a 6e  25 0d 02 3a 1b 43 25 3d  |48-160*n%..:.C%=|
00000560  31 3a 53 25 3d 6e 25 3a  f2 63 61 72 64 28 43 25  |1:S%=n%:.card(C%|
00000570  2c 53 25 29 0d 02 44 05  ed 0d 02 4e 18 6e 25 3d  |,S%)..D....N.n%=|
00000580  31 3a e3 49 25 3d 31 b8  38 3a e3 4a 25 3d 31 b8  |1:.I%=1.8:.J%=1.|
00000590  36 0d 02 58 35 43 25 28  49 25 2c 4a 25 29 3d 63  |6..X5C%(I%,J%)=c|
000005a0  25 28 4e 25 28 6e 25 29  29 3a 53 25 28 49 25 2c  |%(N%(n%)):S%(I%,|
000005b0  4a 25 29 3d 73 25 28 4e  25 28 6e 25 29 29 3a 6e  |J%)=s%(N%(n%)):n|
000005c0  25 3d 6e 25 2b 31 0d 02  62 07 ed 3a ed 0d 02 6c  |%=n%+1..b..:...l|
000005d0  05 e1 0d 02 76 05 3a 0d  02 80 0a dd f2 66 69 76  |....v.:......fiv|
000005e0  65 0d 02 8a 1e f1 3b bd  32 34 31 3b bd 38 3b bd  |e.....;.241;.8;.|
000005f0  31 30 3b bd 32 34 30 3b  bd 38 3b bd 31 30 3b 0d  |10;.240;.8;.10;.|
00000600  02 94 05 e1 0d 02 9e 05  3a 0d 02 a8 17 dd f2 63  |........:......c|
00000610  61 72 64 28 63 61 72 64  25 2c 73 75 69 74 25 29  |ard(card%,suit%)|
00000620  0d 02 b2 06 ef 35 0d 02  bc 3a e7 28 73 75 69 74  |.....5...:.(suit|
00000630  25 3d 31 20 84 73 75 69  74 25 3d 33 29 20 63 6f  |%=1 .suit%=3) co|
00000640  6c 25 3d 31 20 8b e7 28  73 75 69 74 25 3d 32 20  |l%=1 ..(suit%=2 |
00000650  84 73 75 69 74 25 3d 34  29 20 63 6f 6c 25 3d 32  |.suit%=4) col%=2|
00000660  0d 02 c6 13 73 75 69 74  25 3d 73 75 69 74 25 2b  |....suit%=suit%+|
00000670  32 32 33 0d 02 d0 29 ef  32 34 2c 58 25 2d 34 3b  |223...).24,X%-4;|
00000680  59 25 2d 34 3b 58 25 2b  31 30 30 3b 59 25 2b 31  |Y%-4;X%+100;Y%+1|
00000690  33 32 3b 3a e6 30 2c 31  33 31 3a da 0d 02 da 47  |32;:.0,131:....G|
000006a0  e6 30 2c 32 3a ec 58 25  2d 34 2c 59 25 2d 34 3a  |.0,2:.X%-4,Y%-4:|
000006b0  df 58 25 2d 34 2c 59 25  2b 31 33 32 3a df 58 25  |.X%-4,Y%+132:.X%|
000006c0  2b 31 30 30 2c 59 25 2b  31 33 32 3a df 58 25 2b  |+100,Y%+132:.X%+|
000006d0  31 30 30 2c 59 25 2d 34  3a df 58 25 2d 34 2c 59  |100,Y%-4:.X%-4,Y|
000006e0  25 2d 34 0d 02 e4 13 e7  63 61 72 64 25 3d 31 20  |%-4.....card%=1 |
000006f0  63 64 25 3d 36 35 0d 02  ee 16 e7 63 61 72 64 25  |cd%=65.....card%|
00000700  3d 31 31 20 63 64 25 3d  97 22 4a 22 0d 02 f8 16  |=11 cd%=."J"....|
00000710  e7 63 61 72 64 25 3d 31  32 20 63 64 25 3d 97 22  |.card%=12 cd%=."|
00000720  51 22 0d 03 02 16 e7 63  61 72 64 25 3d 31 33 20  |Q".....card%=13 |
00000730  63 64 25 3d 97 22 4b 22  0d 03 0c 23 e7 63 61 72  |cd%=."K"...#.car|
00000740  64 25 3e 31 20 80 63 61  72 64 25 3c 31 30 20 63  |d%>1 .card%<10 c|
00000750  64 25 3d 63 61 72 64 25  2b 34 38 0d 03 16 15 e7  |d%=card%+48.....|
00000760  63 61 72 64 25 3d 31 30  20 63 64 25 3d 32 32 39  |card%=10 cd%=229|
00000770  0d 03 20 06 f2 70 0d 03  2a 07 f2 70 70 0d 03 34  |.. ..p..*..pp..4|
00000780  05 e1 0d 03 3e 05 3a 0d  03 48 07 dd f2 70 0d 03  |....>.:..H...p..|
00000790  52 30 ec 58 25 2c 59 25  2b 32 38 3a e6 30 2c 63  |R0.X%,Y%+28:.0,c|
000007a0  6f 6c 25 3a f1 3b bd 73  75 69 74 25 3a ec 58 25  |ol%:.;.suit%:.X%|
000007b0  2c 59 25 2b 31 32 38 3a  f1 3b bd 63 64 25 0d 03  |,Y%+128:.;.cd%..|
000007c0  5c 2e ec 58 25 2b 36 34  2c 59 25 2b 32 38 3a f1  |\..X%+64,Y%+28:.|
000007d0  3b bd 63 64 25 3a ec 58  25 2b 36 34 2c 59 25 2b  |;.cd%:.X%+64,Y%+|
000007e0  31 32 38 3a f1 3b bd 73  75 69 74 25 0d 03 66 05  |128:.;.suit%..f.|
000007f0  e1 0d 03 70 05 3a 0d 03  7a 08 dd f2 70 70 0d 03  |...p.:..z...pp..|
00000800  84 24 e7 63 61 72 64 25  3d 31 20 ec 58 25 2b 33  |.$.card%=1 .X%+3|
00000810  32 2c 59 25 2b 38 30 3a  f1 3b bd 73 75 69 74 25  |2,Y%+80:.;.suit%|
00000820  3a e1 0d 03 8e 38 e7 63  61 72 64 25 3d 32 20 ec  |:....8.card%=2 .|
00000830  58 25 2b 33 32 2c 59 25  2b 31 32 30 3a f1 3b bd  |X%+32,Y%+120:.;.|
00000840  32 33 39 3b 3a ec 58 25  2b 33 32 2c 59 25 2b 35  |239;:.X%+32,Y%+5|
00000850  36 3a f1 3b bd 32 33 39  3a e1 0d 03 98 4d e7 63  |6:.;.239:....M.c|
00000860  61 72 64 25 3d 33 20 ec  58 25 2b 33 32 2c 59 25  |ard%=3 .X%+32,Y%|
00000870  2b 31 32 30 3a f1 3b bd  32 33 39 3b 3a ec 58 25  |+120:.;.239;:.X%|
00000880  2b 33 32 2c 59 25 2b 38  38 3a f1 3b bd 32 33 39  |+32,Y%+88:.;.239|
00000890  3b 3a ec 58 25 2b 33 32  2c 59 25 2b 35 36 3a f1  |;:.X%+32,Y%+56:.|
000008a0  3b bd 32 33 39 3a e1 0d  03 a2 38 e7 63 61 72 64  |;.239:....8.card|
000008b0  25 3d 34 20 ec 58 25 2b  33 32 2c 59 25 2b 31 30  |%=4 .X%+32,Y%+10|
000008c0  34 3a f1 3b bd 32 34 30  3b 3a ec 58 25 2b 33 32  |4:.;.240;:.X%+32|
000008d0  2c 59 25 2b 34 30 3a f1  3b bd 32 34 30 3a e1 0d  |,Y%+40:.;.240:..|
000008e0  03 ac 4d e7 63 61 72 64  25 3d 35 20 ec 58 25 2b  |..M.card%=5 .X%+|
000008f0  33 32 2c 59 25 2b 31 30  34 3a f1 3b bd 32 34 30  |32,Y%+104:.;.240|
00000900  3b 3a ec 58 25 2b 33 32  2c 59 25 2b 38 38 3a f1  |;:.X%+32,Y%+88:.|
00000910  3b bd 32 33 39 3b 3a ec  58 25 2b 33 32 2c 59 25  |;.239;:.X%+32,Y%|
00000920  2b 34 30 3a f1 3b bd 32  34 30 3a e1 0d 03 b6 4d  |+40:.;.240:....M|
00000930  e7 63 61 72 64 25 3d 36  20 ec 58 25 2b 33 32 2c  |.card%=6 .X%+32,|
00000940  59 25 2b 31 30 34 3a f1  3b bd 32 34 30 3b 3a ec  |Y%+104:.;.240;:.|
00000950  58 25 2b 33 32 2c 59 25  2b 37 32 3a f1 3b bd 32  |X%+32,Y%+72:.;.2|
00000960  34 30 3b 3a ec 58 25 2b  33 32 2c 59 25 2b 34 30  |40;:.X%+32,Y%+40|
00000970  3a f1 3b bd 32 34 30 3a  e1 0d 03 c0 36 e7 63 61  |:.;.240:....6.ca|
00000980  72 64 25 3d 37 20 ec 58  25 2b 33 32 2c 59 25 2b  |rd%=7 .X%+32,Y%+|
00000990  31 30 34 3a f2 66 69 76  65 3a ec 58 25 2b 33 32  |104:.five:.X%+32|
000009a0  2c 59 25 2b 34 30 3a f1  3b bd 32 34 30 3a e1 0d  |,Y%+40:.;.240:..|
000009b0  03 ca 37 e7 63 61 72 64  25 3d 38 20 ec 58 25 2b  |..7.card%=8 .X%+|
000009c0  33 32 2c 59 25 2b 31 30  34 3a f1 3b bd 32 34 31  |32,Y%+104:.;.241|
000009d0  3b 3a ec 58 25 2b 33 32  2c 59 25 2b 37 32 3a f2  |;:.X%+32,Y%+72:.|
000009e0  66 69 76 65 3a e1 0d 03  d4 4b e7 63 61 72 64 25  |five:....K.card%|
000009f0  3d 39 20 ec 58 25 2b 33  32 2c 59 25 2b 31 31 32  |=9 .X%+32,Y%+112|
00000a00  3a f1 3b bd 32 34 30 3b  3a ec 58 25 2b 33 32 2c  |:.;.240;:.X%+32,|
00000a10  59 25 2b 38 38 3a f2 66  69 76 65 3a ec 58 25 2b  |Y%+88:.five:.X%+|
00000a20  33 32 2c 59 25 2b 33 32  3a f1 3b bd 32 34 30 3a  |32,Y%+32:.;.240:|
00000a30  e1 0d 03 de 36 e7 63 61  72 64 25 3d 31 30 20 ec  |....6.card%=10 .|
00000a40  58 25 2b 33 32 2c 59 25  2b 31 31 32 3a f2 66 69  |X%+32,Y%+112:.fi|
00000a50  76 65 3a ec 58 25 2b 33  32 2c 59 25 2b 36 36 3a  |ve:.X%+32,Y%+66:|
00000a60  f2 66 69 76 65 3a e1 0d  03 e8 3b e7 63 61 72 64  |.five:....;.card|
00000a70  25 3d 31 31 20 43 24 3d  bd 32 34 32 20 8b e7 63  |%=11 C$=.242 ..c|
00000a80  61 72 64 25 3d 31 32 20  43 24 3d bd 32 34 33 20  |ard%=12 C$=.243 |
00000a90  8b e7 63 61 72 64 25 3d  31 33 20 43 24 3d bd 32  |..card%=13 C$=.2|
00000aa0  34 34 0d 03 f2 59 e7 63  61 72 64 25 3d 31 31 20  |44...Y.card%=11 |
00000ab0  44 24 3d bd 32 34 38 2b  bd 32 34 39 2b bd 32 35  |D$=.248+.249+.25|
00000ac0  32 20 8b e7 63 61 72 64  25 3d 31 32 20 44 24 3d  |2 ..card%=12 D$=|
00000ad0  bd 32 34 38 2b bd 32 35  30 2b bd 32 35 32 20 8b  |.248+.250+.252 .|
00000ae0  e7 63 61 72 64 25 3d 31  33 20 44 24 3d bd 32 34  |.card%=13 D$=.24|
00000af0  38 2b bd 32 35 31 2b bd  32 35 32 0d 03 fc 15 ec  |8+.251+.252.....|
00000b00  58 25 2b 33 32 2c 59 25  2b 31 32 38 3a f1 43 24  |X%+32,Y%+128:.C$|
00000b10  0d 04 06 1d ec 58 25 2c  59 25 2b 39 36 3a f1 bd  |.....X%,Y%+96:..|
00000b20  32 34 35 2b bd 32 34 36  2b bd 32 34 37 0d 04 10  |245+.246+.247...|
00000b30  1e e6 30 2c 30 3a ec 58  25 2c 59 25 2b 36 34 3a  |..0,0:.X%,Y%+64:|
00000b40  f1 44 24 3a e6 30 2c 63  6f 6c 25 0d 04 1a 18 ec  |.D$:.0,col%.....|
00000b50  58 25 2b 33 32 2c 59 25  2b 33 32 3a f1 bd 32 35  |X%+32,Y%+32:..25|
00000b60  33 3a e1 0d 04 24 05 3a  0d 04 2e 0a dd f2 64 65  |3:...$.:......de|
00000b70  61 6c 0d 04 38 12 59 25  3d 36 38 38 3a e3 49 25  |al..8.Y%=688:.I%|
00000b80  3d 31 b8 38 0d 04 42 18  e7 49 25 3e 34 20 8c 4b  |=1.8..B..I%>4 .K|
00000b90  25 3d 38 34 38 20 8b 4b  25 3d 38 30 0d 04 4c 1b  |%=848 .K%=80..L.|
00000ba0  e3 4a 25 3d 31 b8 36 3a  58 25 3d 4b 25 2b 34 30  |.J%=1.6:X%=K%+40|
00000bb0  2a 28 4a 25 2d 31 29 0d  04 56 1d 43 25 3d 43 25  |*(J%-1)..V.C%=C%|
00000bc0  28 49 25 2c 4a 25 29 3a  53 25 3d 53 25 28 49 25  |(I%,J%):S%=S%(I%|
00000bd0  2c 4a 25 29 0d 04 60 10  f2 63 61 72 64 28 43 25  |,J%)..`..card(C%|
00000be0  2c 53 25 29 0d 04 6a 05  ed 0d 04 74 1c e7 49 25  |,S%)..j....t..I%|
00000bf0  3d 34 20 8c 59 25 3d 36  38 38 20 8b 59 25 3d 59  |=4 .Y%=688 .Y%=Y|
00000c00  25 2d 31 36 30 0d 04 7e  05 ed 0d 04 88 20 ef 34  |%-160..~..... .4|
00000c10  3a e3 6e 25 3d 31 b8 34  3a f1 8a 31 36 2c 6e 25  |:.n%=1.4:..16,n%|
00000c20  2a 35 2b 33 29 3b 6e 25  3a ed 0d 04 92 2c e3 6e  |*5+3);n%:....,.n|
00000c30  25 3d 31 b8 38 3a e7 6e  25 3e 34 20 8c 78 25 3d  |%=1.8:.n%>4 .x%=|
00000c40  32 35 3a 79 25 3d 6e 25  2d 34 20 8b 78 25 3d 31  |25:y%=n%-4 .x%=1|
00000c50  3a 79 25 3d 6e 25 0d 04  9c 1b f1 8a 78 25 2c 35  |:y%=n%......x%,5|
00000c60  2a 79 25 2b 33 29 bd 28  36 34 2b 6e 25 29 3b 3a  |*y%+3).(64+n%);:|
00000c70  ed 0d 04 a6 05 e1 0d 04  b0 05 3a 0d 04 ba 0b dd  |..........:.....|
00000c80  f2 65 6e 74 65 72 0d 04  c4 1e f1 8a 31 34 2c 32  |.enter......14,2|
00000c90  38 29 3b 22 4d 6f 76 65  20 4e 6f 2e 20 22 3b 6d  |8);"Move No. ";m|
00000ca0  6f 76 65 25 0d 04 ce 1a  f1 8a 36 2c 33 30 29 3b  |ove%......6,30);|
00000cb0  22 4d 6f 76 65 20 66 72  6f 6d 3f 20 22 3b 0d 04  |"Move from? ";..|
00000cc0  d8 10 66 6c 61 67 25 3d  a3 3a f2 6b 65 79 0d 04  |..flag%=.:.key..|
00000cd0  e2 0d e7 4b 24 3d 22 55  22 20 e1 0d 04 ec 09 63  |...K$="U" .....c|
00000ce0  68 6b 3d b9 0d 04 f6 0c  66 72 6f 6d 25 3d 61 25  |hk=.....from%=a%|
00000cf0  0d 05 00 07 f1 4b 24 0d  05 0a 19 f1 8a 32 36 2c  |.....K$......26,|
00000d00  33 30 29 3b 22 4d 6f 76  65 20 74 6f 3f 20 22 3b  |30);"Move to? ";|
00000d10  0d 05 14 10 66 6c 61 67  25 3d b9 3a f2 6b 65 79  |....flag%=.:.key|
00000d20  0d 05 1e 0a 74 6f 25 3d  61 25 0d 05 28 07 f1 4b  |....to%=a%..(..K|
00000d30  24 0d 05 32 1b e3 7a 25  3d 31 b8 31 30 30 3a ed  |$..2..z%=1.100:.|
00000d40  3a f1 8a 34 2c 33 30 29  3b 89 33 35 0d 05 3c 05  |:..4,30);.35..<.|
00000d50  e1 0d 05 46 05 3a 0d 05  50 09 dd f2 6b 65 79 0d  |...F.:..P...key.|
00000d60  05 5a 2d e7 66 6c 61 67  25 20 41 24 3d 22 41 42  |.Z-.flag% A$="AB|
00000d70  43 44 45 46 47 48 31 32  33 34 22 20 8b 20 41 24  |CDEFGH1234" . A$|
00000d80  3d 22 41 42 43 44 45 46  47 48 55 22 0d 05 64 13  |="ABCDEFGHU"..d.|
00000d90  f5 3a 61 25 3d a7 41 24  2c be 29 3a fd 61 25 0d  |.:a%=.A$,.):.a%.|
00000da0  05 6e 10 4b 24 3d c1 41  24 2c 61 25 2c 31 29 0d  |.n.K$=.A$,a%,1).|
00000db0  05 78 1a e7 4b 24 3d 22  55 22 20 63 68 6b 3d a3  |.x..K$="U" chk=.|
00000dc0  3a f2 75 6e 64 6f 3a e1  20 0d 05 82 0c 6d 24 3d  |:.undo:. ....m$=|
00000dd0  6d 24 2b 4b 24 0d 05 8c  05 e1 0d 05 96 05 3a 0d  |m$+K$.........:.|
00000de0  05 a0 11 dd f2 63 68 65  63 6b 3a 6d 76 25 3d b9  |.....check:mv%=.|
00000df0  0d 05 aa 18 e7 44 25 28  66 72 6f 6d 25 29 3d 30  |.....D%(from%)=0|
00000e00  20 6d 76 25 3d a3 3a e1  0d 05 b4 14 e7 74 6f 25  | mv%=.:......to%|
00000e10  3c 39 3a f2 63 68 65 63  6b 32 3a e1 0d 05 be 29  |<9:.check2:....)|
00000e20  e7 53 25 28 66 72 6f 6d  25 2c 44 25 28 66 72 6f  |.S%(from%,D%(fro|
00000e30  6d 25 29 29 3c 3e 28 74  6f 25 2d 38 29 20 6d 76  |m%))<>(to%-8) mv|
00000e40  25 3d a3 3a e1 0d 05 c8  2d e7 43 25 28 66 72 6f  |%=.:....-.C%(fro|
00000e50  6d 25 2c 44 25 28 66 72  6f 6d 25 29 29 3c 3e 41  |m%,D%(from%))<>A|
00000e60  25 28 74 6f 25 2d 38 29  2b 31 20 6d 76 25 3d a3  |%(to%-8)+1 mv%=.|
00000e70  3a e1 0d 05 d2 05 e1 0d  05 dc 05 3a 0d 05 e6 0c  |:..........:....|
00000e80  dd f2 63 68 65 63 6b 32  0d 05 f0 17 e7 44 25 28  |..check2.....D%(|
00000e90  74 6f 25 29 3d 31 36 20  6d 76 25 3d a3 3a e1 0d  |to%)=16 mv%=.:..|
00000ea0  05 fa 16 e7 44 25 28 74  6f 25 29 3d 30 20 6d 76  |....D%(to%)=0 mv|
00000eb0  25 3d b9 3a e1 0d 06 04  33 e7 43 25 28 66 72 6f  |%=.:....3.C%(fro|
00000ec0  6d 25 2c 44 25 28 66 72  6f 6d 25 29 29 2b 31 3c  |m%,D%(from%))+1<|
00000ed0  3e 43 25 28 74 6f 25 2c  44 25 28 74 6f 25 29 29  |>C%(to%,D%(to%))|
00000ee0  20 6d 76 25 3d a3 3a e1  0d 06 0e 05 e1 0d 06 18  | mv%=.:.........|
00000ef0  05 3a 0d 06 22 0a dd f2  66 72 6f 6d 0d 06 2c 12  |.:.."...from..,.|
00000f00  e7 66 72 6f 6d 25 3e 38  20 e5 8d 74 6e 46 0d 06  |.from%>8 ..tnF..|
00000f10  36 33 43 31 25 3d 43 25  28 66 72 6f 6d 25 2c 44  |63C1%=C%(from%,D|
00000f20  25 28 66 72 6f 6d 25 29  29 3a 53 31 25 3d 53 25  |%(from%)):S1%=S%|
00000f30  28 66 72 6f 6d 25 2c 44  25 28 66 72 6f 6d 25 29  |(from%,D%(from%)|
00000f40  29 0d 06 40 2f 43 25 28  66 72 6f 6d 25 2c 44 25  |)..@/C%(from%,D%|
00000f50  28 66 72 6f 6d 25 29 29  3d 30 3a 53 25 28 66 72  |(from%))=0:S%(fr|
00000f60  6f 6d 25 2c 44 25 28 66  72 6f 6d 25 29 29 3d 30  |om%,D%(from%))=0|
00000f70  0d 06 4a 1e 44 25 28 66  72 6f 6d 25 29 3d 44 25  |..J.D%(from%)=D%|
00000f80  28 66 72 6f 6d 25 29 2d  31 3a 5a 25 3d 31 0d 06  |(from%)-1:Z%=1..|
00000f90  54 20 e7 44 25 28 66 72  6f 6d 25 29 3e 36 20 8c  |T .D%(from%)>6 .|
00000fa0  5a 25 3d 44 25 28 66 72  6f 6d 25 29 2d 36 0d 06  |Z%=D%(from%)-6..|
00000fb0  5e 42 e7 66 72 6f 6d 25  3e 34 20 4b 25 3d 38 34  |^B.from%>4 K%=84|
00000fc0  38 3a 59 25 3d 38 34 38  2d 31 36 30 2a 28 66 72  |8:Y%=848-160*(fr|
00000fd0  6f 6d 25 2d 34 29 20 8b  4b 25 3d 38 30 3a 59 25  |om%-4) .K%=80:Y%|
00000fe0  3d 38 34 38 2d 31 36 30  2a 28 66 72 6f 6d 25 29  |=848-160*(from%)|
00000ff0  0d 06 68 29 e6 30 2c 31  32 38 3a ef 32 34 2c 4b  |..h).0,128:.24,K|
00001000  25 2d 38 3b 59 25 2d 38  3b 4b 25 2b 34 30 30 3b  |%-8;Y%-8;K%+400;|
00001010  59 25 2b 31 35 30 3b 3a  da 0d 06 72 17 e7 20 44  |Y%+150;:...r.. D|
00001020  25 28 66 72 6f 6d 25 29  3d 30 20 e5 8d 74 64 46  |%(from%)=0 ..tdF|
00001030  0d 06 7c 2f 49 25 3d 66  72 6f 6d 25 3a e3 4a 25  |..|/I%=from%:.J%|
00001040  3d 5a 25 b8 20 44 25 28  66 72 6f 6d 25 29 3a 58  |=Z%. D%(from%):X|
00001050  25 3d 4b 25 2b 34 30 2a  28 4a 25 2d 5a 25 29 0d  |%=K%+40*(J%-Z%).|
00001060  06 86 1d 43 25 3d 43 25  28 49 25 2c 4a 25 29 3a  |...C%=C%(I%,J%):|
00001070  53 25 3d 53 25 28 49 25  2c 4a 25 29 0d 06 90 10  |S%=S%(I%,J%)....|
00001080  f2 63 61 72 64 28 43 25  2c 53 25 29 0d 06 9a 05  |.card(C%,S%)....|
00001090  ed 0d 06 a4 05 e1 0d 06  ae 11 66 72 6f 6d 25 3d  |..........from%=|
000010a0  66 72 6f 6d 25 2d 38 0d  06 b8 1b 43 31 25 3d 41  |from%-8....C1%=A|
000010b0  25 28 66 72 6f 6d 25 29  3a 53 31 25 3d 66 72 6f  |%(from%):S1%=fro|
000010c0  6d 25 0d 06 c2 19 41 25  28 66 72 6f 6d 25 29 3d  |m%....A%(from%)=|
000010d0  41 25 28 66 72 6f 6d 25  29 2d 31 0d 06 cc 1b 58  |A%(from%)-1....X|
000010e0  25 3d 35 36 30 3a 59 25  3d 38 34 38 2d 31 36 30  |%=560:Y%=848-160|
000010f0  2a 66 72 6f 6d 25 0d 06  d6 19 43 25 3d 41 25 28  |*from%....C%=A%(|
00001100  66 72 6f 6d 25 29 3a 53  25 3d 66 72 6f 6d 25 0d  |from%):S%=from%.|
00001110  06 e0 10 f2 63 61 72 64  28 43 25 2c 53 25 29 0d  |....card(C%,S%).|
00001120  06 ea 05 e1 0d 06 f4 05  3a 0d 06 fe 08 dd f2 74  |........:......t|
00001130  6f 0d 07 08 10 e7 74 6f  25 3e 38 20 e5 8d 44 76  |o.....to%>8 ..Dv|
00001140  47 0d 07 12 1a 44 25 28  74 6f 25 29 3d 44 25 28  |G....D%(to%)=D%(|
00001150  74 6f 25 29 2b 31 3a 5a  25 3d 31 0d 07 1c 1c e7  |to%)+1:Z%=1.....|
00001160  20 44 25 28 74 6f 25 29  3e 37 20 5a 25 3d 44 25  | D%(to%)>7 Z%=D%|
00001170  28 74 6f 25 29 2d 36 0d  07 26 2b 43 25 28 74 6f  |(to%)-6..&+C%(to|
00001180  25 2c 44 25 28 74 6f 25  29 29 3d 43 31 25 3a 53  |%,D%(to%))=C1%:S|
00001190  25 28 74 6f 25 2c 44 25  28 74 6f 25 29 29 3d 53  |%(to%,D%(to%))=S|
000011a0  31 25 0d 07 30 3c e7 74  6f 25 3e 34 20 4b 25 3d  |1%..0<.to%>4 K%=|
000011b0  38 34 38 3a 59 25 3d 38  34 38 2d 31 36 30 2a 28  |848:Y%=848-160*(|
000011c0  74 6f 25 2d 34 29 20 8b  4b 25 3d 38 30 3a 59 25  |to%-4) .K%=80:Y%|
000011d0  3d 38 34 38 2d 31 36 30  2a 28 74 6f 25 29 0d 07  |=848-160*(to%)..|
000011e0  3a 29 e6 30 2c 31 32 38  3a ef 32 34 2c 4b 25 2d  |:).0,128:.24,K%-|
000011f0  38 3b 59 25 2d 38 3b 4b  25 2b 34 30 30 3b 59 25  |8;Y%-8;K%+400;Y%|
00001200  2b 31 35 30 3b 3a da 0d  07 44 2c 49 25 3d 74 6f  |+150;:...D,I%=to|
00001210  25 3a e3 4a 25 3d 5a 25  20 b8 20 44 25 28 74 6f  |%:.J%=Z% . D%(to|
00001220  25 29 3a 58 25 3d 4b 25  2b 34 30 2a 28 4a 25 2d  |%):X%=K%+40*(J%-|
00001230  5a 25 29 0d 07 4e 1d 43  25 3d 43 25 28 49 25 2c  |Z%)..N.C%=C%(I%,|
00001240  4a 25 29 3a 53 25 3d 53  25 28 49 25 2c 4a 25 29  |J%):S%=S%(I%,J%)|
00001250  0d 07 58 10 f2 63 61 72  64 28 43 25 2c 53 25 29  |..X..card(C%,S%)|
00001260  0d 07 62 05 ed 0d 07 6c  05 e1 0d 07 76 0d 74 6f  |..b....l....v.to|
00001270  25 3d 74 6f 25 2d 38 0d  07 80 15 41 25 28 74 6f  |%=to%-8....A%(to|
00001280  25 29 3d 41 25 28 74 6f  25 29 2b 31 0d 07 8a 19  |%)=A%(to%)+1....|
00001290  58 25 3d 35 36 30 3a 59  25 3d 38 34 38 2d 31 36  |X%=560:Y%=848-16|
000012a0  30 2a 74 6f 25 0d 07 94  15 43 25 3d 41 25 28 74  |0*to%....C%=A%(t|
000012b0  6f 25 29 3a 53 25 3d 74  6f 25 0d 07 9e 10 f2 63  |o%):S%=to%.....c|
000012c0  61 72 64 28 43 25 2c 53  25 29 0d 07 a8 05 e1 0d  |ard(C%,S%)......|
000012d0  07 b2 05 3a 0d 07 bc 52  2a 4b 2e 30 20 2a 54 2e  |...:...R*K.0 *T.|
000012e0  7c 4d 46 4f 52 49 25 3d  30 54 4f 20 54 4f 50 2d  ||MFORI%=0TO TOP-|
000012f0  50 41 47 45 20 53 54 45  50 34 3a 49 25 21 26 45  |PAGE STEP4:I%!&E|
00001300  30 30 3d 49 25 21 50 41  47 45 3a 4e 45 58 54 7c  |00=I%!PAGE:NEXT||
00001310  4d 50 41 47 45 3d 26 45  30 30 7c 4d 4f 4c 44 7c  |MPAGE=&E00|MOLD||
00001320  4d 52 55 4e 7c 4d 0d 07  c6 10 2a 46 58 31 33 38  |MRUN|M....*FX138|
00001330  2c 30 2c 31 32 38 0d 07  d0 05 e0 0d 07 da 05 3a  |,0,128.........:|
00001340  0d 07 e4 18 dd f2 77 69  6e 3a ef 32 33 2c 31 2c  |......win:.23,1,|
00001350  30 3b 30 3b 30 3b 30 3b  0d 07 ee 1e f1 8a 31 31  |0;0;0;0;......11|
00001360  2c 34 29 22 43 4f 4e 47  52 41 54 55 4c 41 54 49  |,4)"CONGRATULATI|
00001370  4f 4e 53 21 21 22 0d 07  f8 1e f1 8a 31 31 2c 35  |ONS!!"......11,5|
00001380  29 22 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |)"--------------|
00001390  2d 2d 2d 22 0d 08 02 2b  f1 8a 34 2c 38 29 22 59  |---"...+..4,8)"Y|
000013a0  6f 75 20 68 61 76 65 20  63 6f 6d 70 6c 65 74 65  |ou have complete|
000013b0  64 20 44 65 61 6c 20 6e  6f 2e 20 22 3b 4d 25 0d  |d Deal no. ";M%.|
000013c0  08 0c 20 f1 8a 31 33 2c  31 30 29 22 69 6e 20 22  |.. ..13,10)"in "|
000013d0  3b 6d 6f 76 65 25 3b 22  20 6d 6f 76 65 73 22 0d  |;move%;" moves".|
000013e0  08 16 22 f1 8a 31 30 2c  31 34 29 22 41 6e 6f 74  |.."..10,14)"Anot|
000013f0  68 65 72 20 64 65 61 6c  3f 20 20 28 59 2f 4e 29  |her deal?  (Y/N)|
00001400  22 0d 08 20 1b f5 3a 4b  24 3d bf 30 3a fd 4b 24  |".. ..:K$=.0:.K$|
00001410  3d 22 59 22 20 84 4b 24  3d 22 4e 22 0d 08 2a 0d  |="Y" .K$="N"..*.|
00001420  6d 6f 76 65 25 3d 30 3a  e1 0d 08 34 05 3a 0d 08  |move%=0:...4.:..|
00001430  3e 0a dd f2 75 6e 64 6f  0d 08 48 09 6d 76 25 3d  |>...undo..H.mv%=|
00001440  b9 0d 08 52 1c e7 20 a9  28 6d 24 29 3c 3d 30 20  |...R.. .(m$)<=0 |
00001450  6d 76 25 3d a3 3a 63 68  6b 3d b9 3a e1 0d 08 5c  |mv%=.:chk=.:...\|
00001460  05 3a 0d 08 66 15 41 24  3d 22 41 42 43 44 45 46  |.:..f.A$="ABCDEF|
00001470  47 48 31 32 33 34 22 0d  08 70 1b 73 24 3d c2 6d  |GH1234"..p.s$=.m|
00001480  24 2c 32 29 3a 6d 24 3d  c0 6d 24 2c a9 6d 24 2d  |$,2):m$=.m$,.m$-|
00001490  32 29 0d 08 7a 15 66 72  6f 6d 25 3d a7 41 24 2c  |2)..z.from%=.A$,|
000014a0  c2 73 24 2c 31 29 29 0d  08 84 12 e7 66 72 6f 6d  |.s$,1)).....from|
000014b0  25 3e 38 20 e5 8d 74 78  46 0d 08 8e 13 74 6f 25  |%>8 ..txF....to%|
000014c0  3d a7 41 24 2c c0 73 24  2c 31 29 29 0d 08 98 05  |=.A$,.s$,1))....|
000014d0  e1 0d 08 a2 11 66 72 6f  6d 25 3d 66 72 6f 6d 25  |.....from%=from%|
000014e0  2d 38 0d 08 ac 1b 43 31  25 3d 41 25 28 66 72 6f  |-8....C1%=A%(fro|
000014f0  6d 25 29 3a 53 31 25 3d  66 72 6f 6d 25 0d 08 b6  |m%):S1%=from%...|
00001500  19 41 25 28 66 72 6f 6d  25 29 3d 41 25 28 66 72  |.A%(from%)=A%(fr|
00001510  6f 6d 25 29 2d 31 0d 08  c0 1b 58 25 3d 35 36 30  |om%)-1....X%=560|
00001520  3a 59 25 3d 38 34 38 2d  31 36 30 2a 66 72 6f 6d  |:Y%=848-160*from|
00001530  25 0d 08 ca 19 43 25 3d  41 25 28 66 72 6f 6d 25  |%....C%=A%(from%|
00001540  29 3a 53 25 3d 66 72 6f  6d 25 0d 08 d4 10 f2 63  |):S%=from%.....c|
00001550  61 72 64 28 43 25 2c 53  25 29 0d 08 de 05 e1 0d  |ard(C%,S%)......|
00001560  08 e8 05 3a 0d ff                                 |...:..|
00001566
G/CASTLE.m0
G/CASTLE.m1
G/CASTLE.m2
G/CASTLE.m4
G/CASTLE.m5