Home » CEEFAX disks » telesoftware16.adl » 14-07-89/BKnight

14-07-89/BKnight

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 » CEEFAX disks » telesoftware16.adl
Filename: 14-07-89/BKnight
Read OK:
File size: 1489 bytes
Load address: FFFF0E00
Exec address: FFFF802B
File contents
   10 REM The Knights Tour.
   20 REM BBC micro version.
   30 REM Rob Anderson April '88.
   40:
   50 ONERROR IFFNdiscerror GOTO150 ELSE END
   60 mode%=129:MODE mode%
   70 DIM board%(8,8),legaldx%(8),legaldy%(8)
   80 PROCinitialise
   90 PROCstart:PROChelp:cont%=FALSE
  100 board%(xstart%,ystart%)=1
  110 finishedok%=FNtrymove(2,xstart%,ystart%)
  120 VDU28,0,31,39,28
  130 COLOURyellow%:COLOUR128:CLS
  140 IFfinishedok% THEN PRINT"Path found." ELSE PRINT"No possible path - press space-bar":REPEATUNTILGET$=" ":RUN
  150 REPEAT
  160 PRINT"Rerun/Printer/File/Screen/Exit"'"R/P/F/S/E ?";
  170 *FX15,0
  180 A$=GET$:PRINTA$
  190 IF A$="R" RUN
  200 IF A$="P" WIDTH80:VDU2:PROCoutputans:VDU3:WIDTH0
  210 IF A$="F" INPUT"Filename? "f$:OSCLI("SPOOL "+f$):PROCoutputans:*SPOOL
  220 IF A$="S" MODE129:PROCoutputans
  230 UNTIL A$="E"
  240 MODE7
  250 END
  260:
  270 DEFPROCinitialise
  280 VDU23,128,0,0,0,0,0,1,2,2
  290 VDU23,129,0,25,42,100,128,0,16,0
  300 VDU23,130,0,128,128,64,32,16,8,8
  310 VDU23,131,4,8,8,24,16,32,41,18
  320 VDU23,132,0,0,0,0,64,128,0,0
  330 VDU23,133,8,8,8,8,8,8,12,4
  340 VDU23,134,12,2,4,24,32,32,31,0
  350 VDU23,135,0,0,0,0,0,0,255,0
  360 VDU23,136,4,6,2,2,2,2,254,0
  370 VDU23,137,0,0,0,0,0,0,1,1
  380 VDU23,138,0,0,17,27,127,255,239,255
  390 VDU23,139,0,0,0,128,192,224,240,240
  400 VDU23,140,3,7,7,7,15,27,22,13
  410 VDU23,141,255,255,255,255,191,127,255,255
  420 VDU23,142,240,240,240,240,240,240,240,248
  430 VDU23,143,3,1,3,7,31,31,0,0
  440 VDU23,144,255,255,255,255,255,255,0,0
  450 VDU23,145,248,248,252,252,252,252,0,0
  460 blackk$=CHR$128+CHR$129+CHR$130+CHR$8+CHR$8+CHR$8+CHR$10+CHR$131+CHR$132+CHR$133+CHR$8+CHR$8+CHR$8+CHR$10+CHR$134+CHR$135+CHR$136
  470 whitek$=CHR$137+CHR$138+CHR$139+CHR$8+CHR$8+CHR$8+CHR$10+CHR$140+CHR$141+CHR$142+CHR$8+CHR$8+CHR$8+CHR$10+CHR$143+CHR$144+CHR$145
  480 w$=CHR$255+CHR$255+CHR$255+CHR$8+CHR$8+CHR$8+CHR$10+CHR$255+CHR$255+CHR$255+CHR$8+CHR$8+CHR$8+CHR$10+CHR$255+CHR$255+CHR$255
  490 IFmode%=4 yellow%=1 ELSE VDU19,1,6;0;0;:yellow%=2
  500 VDU23,1,0;0;0;0;:REM cursor off
  510 WIDTH0
  520 cont%=TRUE
  530 COLOURyellow%
  540 PRINTTAB(10)"The Knights Tour"'TAB(10)STRING$(16,"-")
  550 xsize%=5:ysize%=5:xstart%=1:ystart%=1
  560 PROCmenu:PROCboard
  570 cont%=FALSE
  580 FOR loop1%=1 TO xsize%
  590 FOR loop2%=1 TO ysize%
  600 board%(loop1%,loop2%)=0
  610 NEXT,
  620 legaldx%(1)=-1:legaldy%(1)=-2
  630 legaldx%(2)=-1:legaldy%(2)=+2
  640 legaldx%(3)=+1:legaldy%(3)=-2
  650 legaldx%(4)=+1:legaldy%(4)=+2
  660 legaldx%(5)=-2:legaldy%(5)=-1
  670 legaldx%(6)=+2:legaldy%(6)=-1
  680 legaldx%(7)=-2:legaldy%(7)=+1
  690 legaldx%(8)=+2:legaldy%(8)=+1
  700 ENDPROC
  710:
  720 DEFPROCmenu
  730 COLOUR1:VDU28,26,18,39,4:CLS
  740 IFxstart%>xsize% xstart%=xsize%
  750 IFystart%>ysize% ystart%=ysize%
  760 PRINT"1) x size ";xsize%''"2) y size ";ysize%''"3) x start ";xstart%''"4) y start ";ystart%
  770 ENDPROC
  780:
  790 DEFPROCboard
  800 VDU28,0,26,25,2:CLS:VDU28,0,27,25,3
  810 COLOUR 3
  820 FORy%=0 TO ysize%-1
  830 IF(y%MOD2=0 OR xsize%<>1) THEN FORx%=(y%MOD2) TO xsize%-1 STEP 2:PRINTTAB(x%*3+1,y%*3);w$;TAB(0,y%*3+1);ysize%-y%;:NEXT ELSE PRINTTAB(0,y%*3+1);ysize%-y%;
  840 NEXT
  850 FORx%=1 TO xsize%:PRINTTAB(x%*3-1,ysize%*3);x%;:NEXT
  860 MOVE28,928:DRAWxsize%*96+32,928
  870 DRAW xsize%*96+32,924-ysize%*96
  880 DRAW 28,924-ysize%*96:DRAW 28,928
  890 IF (ysize%-ystart%)MOD2<>0 THEN blksqr%=((xstart%MOD2)<>0) ELSE blksqr%=((xstart%MOD2)=0)
  900 PROCplotK(xstart%,ystart%)
  910 PRINTTAB((xstart%-1)*3+1,(ysize%-ystart%)*3);k$;
  920 COLOUR128:VDU28,26,25,39,14:CLS
  930 ENDPROC
  940:
  950 DEFPROChelp
  960 VDU28,0,31,39,29
  970 COLOUR128:COLOUR1:CLS
  980 PRINT"C - continuous search for solution."'"S - single step."'"R - restart with new parameters.";
  990 ENDPROC
 1000:
 1010 DEFFNtrymove(movenum%,x%,y%)
 1020 REM the main recursive procedure!
 1030 LOCAL trynumber%,goodmove%,i%,j%
 1040 trynumber%=0
 1050 REM main loop
 1060 trynumber% = trynumber% + 1
 1070 goodmove% = FALSE
 1080 i% = x% + legaldx%(trynumber%)
 1090 j% = y% + legaldy%(trynumber%)
 1100 IF NOT (i%>0 AND i%<=xsize% AND j%>0 AND j%<=ysize%) THEN GOTO 1140
 1110 REM proposed move is on the board
 1120 IF board%(i%,j%)=0 THEN board%(i%,j%)=movenum%:PROCplotK(i%,j%):goodmove%=FNtrymove(movenum%+1,i%,j%):IF NOT(goodmove%) THEN board%(i%,j%)=0:PROCundoK(i%,j%,x%,y%)
 1130 IF movenum%=xsize%*ysize%+1 THEN goodmove%=TRUE:REM found solution
 1140 REM label for goto
 1150 IF NOT(goodmove% OR (trynumber%=8)) GOTO 1050:REM loop until finished or all moves tried.
 1160 =goodmove%
 1170:
 1180 DEFPROCplotK(x%,y%)
 1190 PROCtrykeys(x%,y%,FALSE)
 1200 VDU26;28,0,26,25,3
 1210 IF blksqr% COLOUR128:COLOUR3:k$=blackk$ ELSE COLOUR131:COLOUR0:k$=whitek$
 1220 blksqr%=NOTblksqr%
 1230 PRINTTAB((x%-1)*3+1,(ysize%-y%)*3);k$;
 1240 ENDPROC
 1250:
 1260 DEFPROCundoK(x%,y%,oldx%,oldy%)
 1270 PROCtrykeys(oldx%,oldy%,TRUE)
 1280 blksqr%=NOTblksqr%
 1290 IF blksqr% COLOUR0 ELSE COLOUR3
 1300 PRINTTAB((x%-1)*3+1,(ysize%-y%)*3);w$;
 1310 ENDPROC
 1320:
 1330 DEFPROCtrykeys(x%,y%,backtrack%)
 1340 *FX15,0
 1350 IF (cont% AND NOT(INKEY(-82)) AND NOT(INKEY(-52))) THEN key$="" ELSE key$=GET$
 1360 IF key$="C" THEN cont%=TRUE
 1370 IF key$="S" THEN cont%=FALSE
 1380 IF key$="R" THEN RUN
 1390 VDU28,26,25,39,14;31,0,10;10
 1400 COLOUR128:COLOUR3
 1410 IF backtrack% THEN PRINT"back"; ELSE PRINT"move";
 1420 PRINT" to ";x%;",";y%
 1430 VDU28,0,26,25,3
 1440 ENDPROC
 1450:
 1460 DEFPROCstart
 1470 COLOUR128:COLOUR1
 1480 REPEAT
 1490 VDU28,0,31,39,29:CLS
 1500 PRINT"Enter option to be changed; 5 to start":key%=GET-48:IFkey%=5 ORkey%<1 OR key%>5 GOTO1590
 1510 PRINT"Change ";
 1520 IFkey%=1 PRINT"x size"; ELSEIFkey%=2 PRINT"y size"; ELSEIFkey%=3 PRINT"x start"; ELSEIFkey%=4 PRINT"y start";
 1530 PRINT" to ?";
 1540 opt%=GET-48:PRINT;opt%
 1550 IF opt%<1 OR opt%>8 THEN VDU7:GOTO1590
 1560 IF key%=3 AND opt%>xsize% THEN VDU7:GOTO1590
 1570 IF key%=4 AND opt%>ysize% THEN VDU7:GOTO1590
 1580 IF key%=1 xsize%=opt% ELSEIFkey%=2 ysize%=opt% ELSEIFkey%=3 xstart%=opt% ELSEIFkey%=4 ystart%=opt%
 1590 PROCmenu
 1600 UNTIL key%=5
 1610 cont%=TRUE:PROCboard:PROChelp
 1620 ENDPROC
 1630:
 1640 DEFPROCoutputans
 1650 PRINT"Start at ";xstart%;",";ystart%
 1660 FORmove%=2 TO (xsize%*ysize%)
 1670 x%=0:y%=1
 1680 REPEAT
 1690 x%=x%+1:IFx%=xsize%+1 THEN x%=1:y%=y%+1
 1700 UNTILboard%(x%,y%)=move%
 1710 PRINT"Move to ";x%;",";y%
 1720 NEXT
 1730 ENDPROC
 1740:
 1750 DEFFNdiscerror
 1760 COLOUR128:COLOURyellow%:REPORT:PRINT
 1770 IF ERR=218 OR ERR=222 OR ERR=216 OR ERR=223 OR ERR=219 OR ERR=217 OR ERR=214 OR ERR=204 OR ERR=191 THEN PRINT"press space-bar":REPEATUNTILGET$=" ": =TRUE
 1780 =FALSE

 � The Knights Tour.
 � BBC micro version.
 � Rob Anderson April '88.
(:
2 � �discerror �tV@ � �
< mode%=129:� mode%
F* � board%(8,8),legaldx%(8),legaldy%(8)
P �initialise
Z �start:�help:cont%=�
d board%(xstart%,ystart%)=1
n, finishedok%=�trymove(2,xstart%,ystart%)
x �28,0,31,39,28
� �yellow%:�128:�
�T �finishedok% � �"Path found." � �"No possible path - press space-bar":���=" ":�
� �
�5 �"Rerun/Printer/File/Screen/Exit"'"R/P/F/S/E ?";
� *FX15,0
�
 A$=�:�A$
� � A$="R" �
�% � A$="P" �80:�2:�outputans:�3:�0
�> � A$="F" �"Filename? "f$:�("SPOOL "+f$):�outputans:*SPOOL
� � A$="S" �129:�outputans
�
 � A$="E"
� �7
� �
:
 ��initialise
 �23,128,0,0,0,0,0,1,2,2
"# �23,129,0,25,42,100,128,0,16,0
,# �23,130,0,128,128,64,32,16,8,8
6! �23,131,4,8,8,24,16,32,41,18
@ �23,132,0,0,0,0,64,128,0,0
J �23,133,8,8,8,8,8,8,12,4
T! �23,134,12,2,4,24,32,32,31,0
^ �23,135,0,0,0,0,0,0,255,0
h �23,136,4,6,2,2,2,2,254,0
r �23,137,0,0,0,0,0,0,1,1
|& �23,138,0,0,17,27,127,255,239,255
�& �23,139,0,0,0,128,192,224,240,240
�  �23,140,3,7,7,7,15,27,22,13
�, �23,141,255,255,255,255,191,127,255,255
�, �23,142,240,240,240,240,240,240,240,248
� �23,143,3,1,3,7,31,31,0,0
�( �23,144,255,255,255,255,255,255,0,0
�( �23,145,248,248,252,252,252,252,0,0
�S blackk$=�128+�129+�130+�8+�8+�8+�10+�131+�132+�133+�8+�8+�8+�10+�134+�135+�136
�S whitek$=�137+�138+�139+�8+�8+�8+�10+�140+�141+�142+�8+�8+�8+�10+�143+�144+�145
�N w$=�255+�255+�255+�8+�8+�8+�10+�255+�255+�255+�8+�8+�8+�10+�255+�255+�255
�0 �mode%=4 yellow%=1 � �19,1,6;0;0;:yellow%=2
�  �23,1,0;0;0;0;:� cursor off
� �0
 cont%=�

 �yellow%
) �10)"The Knights Tour"'�10)�16,"-")
&* xsize%=5:ysize%=5:xstart%=1:ystart%=1
0 �menu:�board
: cont%=�
D � loop1%=1 � xsize%
N � loop2%=1 � ysize%
X board%(loop1%,loop2%)=0
b �,
l" legaldx%(1)=-1:legaldy%(1)=-2
v" legaldx%(2)=-1:legaldy%(2)=+2
�" legaldx%(3)=+1:legaldy%(3)=-2
�" legaldx%(4)=+1:legaldy%(4)=+2
�" legaldx%(5)=-2:legaldy%(5)=-1
�" legaldx%(6)=+2:legaldy%(6)=-1
�" legaldx%(7)=-2:legaldy%(7)=+1
�" legaldx%(8)=+2:legaldy%(8)=+1
� �
�:
� ��menu
� �1:�28,26,18,39,4:�
�# �xstart%>xsize% xstart%=xsize%
�# �ystart%>ysize% ystart%=ysize%
�\ �"1) x size ";xsize%''"2) y size ";ysize%''"3) x start ";xstart%''"4) y start ";ystart%
 �
:
 ��board
 " �28,0,26,25,2:�:�28,0,27,25,3
* � 3
4 �y%=0 � ysize%-1
>y �(y%�2=0 � xsize%<>1) � �x%=(y%�2) � xsize%-1 � 2:�x%*3+1,y%*3);w$;�0,y%*3+1);ysize%-y%;:� � �0,y%*3+1);ysize%-y%;
H �
R, �x%=1 � xsize%:�x%*3-1,ysize%*3);x%;:�
\ �28,928:�xsize%*96+32,928
f! � xsize%*96+32,924-ysize%*96
p  � 28,924-ysize%*96:� 28,928
zQ � (ysize%-ystart%)�2<>0 � blksqr%=((xstart%�2)<>0) � blksqr%=((xstart%�2)=0)
� �plotK(xstart%,ystart%)
�. �(xstart%-1)*3+1,(ysize%-ystart%)*3);k$;
� �128:�28,26,25,39,14:�
� �
�:
� ��help
� �28,0,31,39,29
� �128:�1:�
�b �"C - continuous search for solution."'"S - single step."'"R - restart with new parameters.";
� �
�:
� ݤtrymove(movenum%,x%,y%)
�$ � the main recursive procedure!
! � trynumber%,goodmove%,i%,j%
 trynumber%=0
 � main loop
$  trynumber% = trynumber% + 1
. goodmove% = �
8# i% = x% + legaldx%(trynumber%)
B# j% = y% + legaldy%(trynumber%)
L9 � � (i%>0 � i%<=xsize% � j%>0 � j%<=ysize%) � � �DtD
V$ � proposed move is on the board
`� � board%(i%,j%)=0 � board%(i%,j%)=movenum%:�plotK(i%,j%):goodmove%=�trymove(movenum%+1,i%,j%):� �(goodmove%) � board%(i%,j%)=0:�undoK(i%,j%,x%,y%)
j> � movenum%=xsize%*ysize%+1 � goodmove%=�:� found solution
t � label for goto
~U � �(goodmove% � (trynumber%=8)) � �TZD:� loop until finished or all moves tried.
� =goodmove%
�:
� ��plotK(x%,y%)
� �trykeys(x%,y%,�)
� �26;28,0,26,25,3
�6 � blksqr% �128:�3:k$=blackk$ � �131:�0:k$=whitek$
� blksqr%=�blksqr%
�$ �(x%-1)*3+1,(ysize%-y%)*3);k$;
� �
�:
� ��undoK(x%,y%,oldx%,oldy%)
� �trykeys(oldx%,oldy%,�)
 blksqr%=�blksqr%

 � blksqr% �0 � �3
$ �(x%-1)*3+1,(ysize%-y%)*3);w$;
 �
(:
2  ��trykeys(x%,y%,backtrack%)
< *FX15,0
F9 � (cont% � �(�(-82)) � �(�(-52))) � key$="" � key$=�
P � key$="C" � cont%=�
Z � key$="S" � cont%=�
d � key$="R" � �
n �28,26,25,39,14;31,0,10;10
x �128:�3
�' � backtrack% � �"back"; � �"move";
� �" to ";x%;",";y%
� �28,0,26,25,3
� �
�:
� ��start
� �128:�1
� �
� �28,0,31,39,29:�
�W �"Enter option to be changed; 5 to start":key%=�-48:�key%=5 �key%<1 � key%>5 �TvF
� �"Change ";
�U �key%=1 �"x size"; ��key%=2 �"y size"; ��key%=3 �"x start"; ��key%=4 �"y start";
� �" to ?";
 opt%=�-48:�;opt%
! � opt%<1 � opt%>8 � �7:�TvF
& � key%=3 � opt%>xsize% � �7:�TvF
"& � key%=4 � opt%>ysize% � �7:�TvF
,Z � key%=1 xsize%=opt% ��key%=2 ysize%=opt% ��key%=3 xstart%=opt% ��key%=4 ystart%=opt%
6
 �menu
@
 � key%=5
J cont%=�:�board:�help
T �
^:
h ��outputans
r% �"Start at ";xstart%;",";ystart%
| �move%=2 � (xsize%*ysize%)
� x%=0:y%=1
� �
�( x%=x%+1:�x%=xsize%+1 � x%=1:y%=y%+1
� �board%(x%,y%)=move%
� �"Move to ";x%;",";y%
� �
� �
�:
� ݤdiscerror
� �128:�yellow%:�:�
�m � �=218 � �=222 � �=216 � �=223 � �=219 � �=217 � �=214 � �=204 � �=191 � �"press space-bar":���=" ": =�
� =�
�
00000000  0d 00 0a 18 20 f4 20 54  68 65 20 4b 6e 69 67 68  |.... . The Knigh|
00000010  74 73 20 54 6f 75 72 2e  0d 00 14 19 20 f4 20 42  |ts Tour..... . B|
00000020  42 43 20 6d 69 63 72 6f  20 76 65 72 73 69 6f 6e  |BC micro version|
00000030  2e 0d 00 1e 1e 20 f4 20  52 6f 62 20 41 6e 64 65  |..... . Rob Ande|
00000040  72 73 6f 6e 20 41 70 72  69 6c 20 27 38 38 2e 0d  |rson April '88..|
00000050  00 28 05 3a 0d 00 32 1d  20 ee 85 20 e7 a4 64 69  |.(.:..2. .. ..di|
00000060  73 63 65 72 72 6f 72 20  e5 8d 74 56 40 20 8b 20  |scerror ..tV@ . |
00000070  e0 0d 00 3c 16 20 6d 6f  64 65 25 3d 31 32 39 3a  |...<. mode%=129:|
00000080  eb 20 6d 6f 64 65 25 0d  00 46 2a 20 de 20 62 6f  |. mode%..F* . bo|
00000090  61 72 64 25 28 38 2c 38  29 2c 6c 65 67 61 6c 64  |ard%(8,8),legald|
000000a0  78 25 28 38 29 2c 6c 65  67 61 6c 64 79 25 28 38  |x%(8),legaldy%(8|
000000b0  29 0d 00 50 10 20 f2 69  6e 69 74 69 61 6c 69 73  |)..P. .initialis|
000000c0  65 0d 00 5a 19 20 f2 73  74 61 72 74 3a f2 68 65  |e..Z. .start:.he|
000000d0  6c 70 3a 63 6f 6e 74 25  3d a3 0d 00 64 1e 20 62  |lp:cont%=...d. b|
000000e0  6f 61 72 64 25 28 78 73  74 61 72 74 25 2c 79 73  |oard%(xstart%,ys|
000000f0  74 61 72 74 25 29 3d 31  0d 00 6e 2c 20 66 69 6e  |tart%)=1..n, fin|
00000100  69 73 68 65 64 6f 6b 25  3d a4 74 72 79 6d 6f 76  |ishedok%=.trymov|
00000110  65 28 32 2c 78 73 74 61  72 74 25 2c 79 73 74 61  |e(2,xstart%,ysta|
00000120  72 74 25 29 0d 00 78 13  20 ef 32 38 2c 30 2c 33  |rt%)..x. .28,0,3|
00000130  31 2c 33 39 2c 32 38 0d  00 82 14 20 fb 79 65 6c  |1,39,28.... .yel|
00000140  6c 6f 77 25 3a fb 31 32  38 3a db 0d 00 8c 54 20  |low%:.128:....T |
00000150  e7 66 69 6e 69 73 68 65  64 6f 6b 25 20 8c 20 f1  |.finishedok% . .|
00000160  22 50 61 74 68 20 66 6f  75 6e 64 2e 22 20 8b 20  |"Path found." . |
00000170  f1 22 4e 6f 20 70 6f 73  73 69 62 6c 65 20 70 61  |."No possible pa|
00000180  74 68 20 2d 20 70 72 65  73 73 20 73 70 61 63 65  |th - press space|
00000190  2d 62 61 72 22 3a f5 fd  be 3d 22 20 22 3a f9 0d  |-bar":...=" ":..|
000001a0  00 96 06 20 f5 0d 00 a0  35 20 f1 22 52 65 72 75  |... ....5 ."Reru|
000001b0  6e 2f 50 72 69 6e 74 65  72 2f 46 69 6c 65 2f 53  |n/Printer/File/S|
000001c0  63 72 65 65 6e 2f 45 78  69 74 22 27 22 52 2f 50  |creen/Exit"'"R/P|
000001d0  2f 46 2f 53 2f 45 20 3f  22 3b 0d 00 aa 0c 20 2a  |/F/S/E ?";.... *|
000001e0  46 58 31 35 2c 30 0d 00  b4 0d 20 41 24 3d be 3a  |FX15,0.... A$=.:|
000001f0  f1 41 24 0d 00 be 0f 20  e7 20 41 24 3d 22 52 22  |.A$.... . A$="R"|
00000200  20 f9 0d 00 c8 25 20 e7  20 41 24 3d 22 50 22 20  | ....% . A$="P" |
00000210  fe 38 30 3a ef 32 3a f2  6f 75 74 70 75 74 61 6e  |.80:.2:.outputan|
00000220  73 3a ef 33 3a fe 30 0d  00 d2 3e 20 e7 20 41 24  |s:.3:.0...> . A$|
00000230  3d 22 46 22 20 e8 22 46  69 6c 65 6e 61 6d 65 3f  |="F" ."Filename?|
00000240  20 22 66 24 3a ff 28 22  53 50 4f 4f 4c 20 22 2b  | "f$:.("SPOOL "+|
00000250  66 24 29 3a f2 6f 75 74  70 75 74 61 6e 73 3a 2a  |f$):.outputans:*|
00000260  53 50 4f 4f 4c 0d 00 dc  1d 20 e7 20 41 24 3d 22  |SPOOL.... . A$="|
00000270  53 22 20 eb 31 32 39 3a  f2 6f 75 74 70 75 74 61  |S" .129:.outputa|
00000280  6e 73 0d 00 e6 0d 20 fd  20 41 24 3d 22 45 22 0d  |ns.... . A$="E".|
00000290  00 f0 07 20 eb 37 0d 00  fa 06 20 e0 0d 01 04 05  |... .7.... .....|
000002a0  3a 0d 01 0e 11 20 dd f2  69 6e 69 74 69 61 6c 69  |:.... ..initiali|
000002b0  73 65 0d 01 18 1c 20 ef  32 33 2c 31 32 38 2c 30  |se.... .23,128,0|
000002c0  2c 30 2c 30 2c 30 2c 30  2c 31 2c 32 2c 32 0d 01  |,0,0,0,0,1,2,2..|
000002d0  22 23 20 ef 32 33 2c 31  32 39 2c 30 2c 32 35 2c  |"# .23,129,0,25,|
000002e0  34 32 2c 31 30 30 2c 31  32 38 2c 30 2c 31 36 2c  |42,100,128,0,16,|
000002f0  30 0d 01 2c 23 20 ef 32  33 2c 31 33 30 2c 30 2c  |0..,# .23,130,0,|
00000300  31 32 38 2c 31 32 38 2c  36 34 2c 33 32 2c 31 36  |128,128,64,32,16|
00000310  2c 38 2c 38 0d 01 36 21  20 ef 32 33 2c 31 33 31  |,8,8..6! .23,131|
00000320  2c 34 2c 38 2c 38 2c 32  34 2c 31 36 2c 33 32 2c  |,4,8,8,24,16,32,|
00000330  34 31 2c 31 38 0d 01 40  1f 20 ef 32 33 2c 31 33  |41,18..@. .23,13|
00000340  32 2c 30 2c 30 2c 30 2c  30 2c 36 34 2c 31 32 38  |2,0,0,0,0,64,128|
00000350  2c 30 2c 30 0d 01 4a 1d  20 ef 32 33 2c 31 33 33  |,0,0..J. .23,133|
00000360  2c 38 2c 38 2c 38 2c 38  2c 38 2c 38 2c 31 32 2c  |,8,8,8,8,8,8,12,|
00000370  34 0d 01 54 21 20 ef 32  33 2c 31 33 34 2c 31 32  |4..T! .23,134,12|
00000380  2c 32 2c 34 2c 32 34 2c  33 32 2c 33 32 2c 33 31  |,2,4,24,32,32,31|
00000390  2c 30 0d 01 5e 1e 20 ef  32 33 2c 31 33 35 2c 30  |,0..^. .23,135,0|
000003a0  2c 30 2c 30 2c 30 2c 30  2c 30 2c 32 35 35 2c 30  |,0,0,0,0,0,255,0|
000003b0  0d 01 68 1e 20 ef 32 33  2c 31 33 36 2c 34 2c 36  |..h. .23,136,4,6|
000003c0  2c 32 2c 32 2c 32 2c 32  2c 32 35 34 2c 30 0d 01  |,2,2,2,2,254,0..|
000003d0  72 1c 20 ef 32 33 2c 31  33 37 2c 30 2c 30 2c 30  |r. .23,137,0,0,0|
000003e0  2c 30 2c 30 2c 30 2c 31  2c 31 0d 01 7c 26 20 ef  |,0,0,0,1,1..|& .|
000003f0  32 33 2c 31 33 38 2c 30  2c 30 2c 31 37 2c 32 37  |23,138,0,0,17,27|
00000400  2c 31 32 37 2c 32 35 35  2c 32 33 39 2c 32 35 35  |,127,255,239,255|
00000410  0d 01 86 26 20 ef 32 33  2c 31 33 39 2c 30 2c 30  |...& .23,139,0,0|
00000420  2c 30 2c 31 32 38 2c 31  39 32 2c 32 32 34 2c 32  |,0,128,192,224,2|
00000430  34 30 2c 32 34 30 0d 01  90 20 20 ef 32 33 2c 31  |40,240...  .23,1|
00000440  34 30 2c 33 2c 37 2c 37  2c 37 2c 31 35 2c 32 37  |40,3,7,7,7,15,27|
00000450  2c 32 32 2c 31 33 0d 01  9a 2c 20 ef 32 33 2c 31  |,22,13..., .23,1|
00000460  34 31 2c 32 35 35 2c 32  35 35 2c 32 35 35 2c 32  |41,255,255,255,2|
00000470  35 35 2c 31 39 31 2c 31  32 37 2c 32 35 35 2c 32  |55,191,127,255,2|
00000480  35 35 0d 01 a4 2c 20 ef  32 33 2c 31 34 32 2c 32  |55..., .23,142,2|
00000490  34 30 2c 32 34 30 2c 32  34 30 2c 32 34 30 2c 32  |40,240,240,240,2|
000004a0  34 30 2c 32 34 30 2c 32  34 30 2c 32 34 38 0d 01  |40,240,240,248..|
000004b0  ae 1e 20 ef 32 33 2c 31  34 33 2c 33 2c 31 2c 33  |.. .23,143,3,1,3|
000004c0  2c 37 2c 33 31 2c 33 31  2c 30 2c 30 0d 01 b8 28  |,7,31,31,0,0...(|
000004d0  20 ef 32 33 2c 31 34 34  2c 32 35 35 2c 32 35 35  | .23,144,255,255|
000004e0  2c 32 35 35 2c 32 35 35  2c 32 35 35 2c 32 35 35  |,255,255,255,255|
000004f0  2c 30 2c 30 0d 01 c2 28  20 ef 32 33 2c 31 34 35  |,0,0...( .23,145|
00000500  2c 32 34 38 2c 32 34 38  2c 32 35 32 2c 32 35 32  |,248,248,252,252|
00000510  2c 32 35 32 2c 32 35 32  2c 30 2c 30 0d 01 cc 53  |,252,252,0,0...S|
00000520  20 62 6c 61 63 6b 6b 24  3d bd 31 32 38 2b bd 31  | blackk$=.128+.1|
00000530  32 39 2b bd 31 33 30 2b  bd 38 2b bd 38 2b bd 38  |29+.130+.8+.8+.8|
00000540  2b bd 31 30 2b bd 31 33  31 2b bd 31 33 32 2b bd  |+.10+.131+.132+.|
00000550  31 33 33 2b bd 38 2b bd  38 2b bd 38 2b bd 31 30  |133+.8+.8+.8+.10|
00000560  2b bd 31 33 34 2b bd 31  33 35 2b bd 31 33 36 0d  |+.134+.135+.136.|
00000570  01 d6 53 20 77 68 69 74  65 6b 24 3d bd 31 33 37  |..S whitek$=.137|
00000580  2b bd 31 33 38 2b bd 31  33 39 2b bd 38 2b bd 38  |+.138+.139+.8+.8|
00000590  2b bd 38 2b bd 31 30 2b  bd 31 34 30 2b bd 31 34  |+.8+.10+.140+.14|
000005a0  31 2b bd 31 34 32 2b bd  38 2b bd 38 2b bd 38 2b  |1+.142+.8+.8+.8+|
000005b0  bd 31 30 2b bd 31 34 33  2b bd 31 34 34 2b bd 31  |.10+.143+.144+.1|
000005c0  34 35 0d 01 e0 4e 20 77  24 3d bd 32 35 35 2b bd  |45...N w$=.255+.|
000005d0  32 35 35 2b bd 32 35 35  2b bd 38 2b bd 38 2b bd  |255+.255+.8+.8+.|
000005e0  38 2b bd 31 30 2b bd 32  35 35 2b bd 32 35 35 2b  |8+.10+.255+.255+|
000005f0  bd 32 35 35 2b bd 38 2b  bd 38 2b bd 38 2b bd 31  |.255+.8+.8+.8+.1|
00000600  30 2b bd 32 35 35 2b bd  32 35 35 2b bd 32 35 35  |0+.255+.255+.255|
00000610  0d 01 ea 30 20 e7 6d 6f  64 65 25 3d 34 20 79 65  |...0 .mode%=4 ye|
00000620  6c 6c 6f 77 25 3d 31 20  8b 20 ef 31 39 2c 31 2c  |llow%=1 . .19,1,|
00000630  36 3b 30 3b 30 3b 3a 79  65 6c 6c 6f 77 25 3d 32  |6;0;0;:yellow%=2|
00000640  0d 01 f4 20 20 ef 32 33  2c 31 2c 30 3b 30 3b 30  |...  .23,1,0;0;0|
00000650  3b 30 3b 3a f4 20 63 75  72 73 6f 72 20 6f 66 66  |;0;:. cursor off|
00000660  0d 01 fe 07 20 fe 30 0d  02 08 0c 20 63 6f 6e 74  |.... .0.... cont|
00000670  25 3d b9 0d 02 12 0d 20  fb 79 65 6c 6c 6f 77 25  |%=..... .yellow%|
00000680  0d 02 1c 29 20 f1 8a 31  30 29 22 54 68 65 20 4b  |...) ..10)"The K|
00000690  6e 69 67 68 74 73 20 54  6f 75 72 22 27 8a 31 30  |nights Tour"'.10|
000006a0  29 c4 31 36 2c 22 2d 22  29 0d 02 26 2a 20 78 73  |).16,"-")..&* xs|
000006b0  69 7a 65 25 3d 35 3a 79  73 69 7a 65 25 3d 35 3a  |ize%=5:ysize%=5:|
000006c0  78 73 74 61 72 74 25 3d  31 3a 79 73 74 61 72 74  |xstart%=1:ystart|
000006d0  25 3d 31 0d 02 30 11 20  f2 6d 65 6e 75 3a f2 62  |%=1..0. .menu:.b|
000006e0  6f 61 72 64 0d 02 3a 0c  20 63 6f 6e 74 25 3d a3  |oard..:. cont%=.|
000006f0  0d 02 44 18 20 e3 20 6c  6f 6f 70 31 25 3d 31 20  |..D. . loop1%=1 |
00000700  b8 20 78 73 69 7a 65 25  0d 02 4e 18 20 e3 20 6c  |. xsize%..N. . l|
00000710  6f 6f 70 32 25 3d 31 20  b8 20 79 73 69 7a 65 25  |oop2%=1 . ysize%|
00000720  0d 02 58 1c 20 62 6f 61  72 64 25 28 6c 6f 6f 70  |..X. board%(loop|
00000730  31 25 2c 6c 6f 6f 70 32  25 29 3d 30 0d 02 62 07  |1%,loop2%)=0..b.|
00000740  20 ed 2c 0d 02 6c 22 20  6c 65 67 61 6c 64 78 25  | .,..l" legaldx%|
00000750  28 31 29 3d 2d 31 3a 6c  65 67 61 6c 64 79 25 28  |(1)=-1:legaldy%(|
00000760  31 29 3d 2d 32 0d 02 76  22 20 6c 65 67 61 6c 64  |1)=-2..v" legald|
00000770  78 25 28 32 29 3d 2d 31  3a 6c 65 67 61 6c 64 79  |x%(2)=-1:legaldy|
00000780  25 28 32 29 3d 2b 32 0d  02 80 22 20 6c 65 67 61  |%(2)=+2..." lega|
00000790  6c 64 78 25 28 33 29 3d  2b 31 3a 6c 65 67 61 6c  |ldx%(3)=+1:legal|
000007a0  64 79 25 28 33 29 3d 2d  32 0d 02 8a 22 20 6c 65  |dy%(3)=-2..." le|
000007b0  67 61 6c 64 78 25 28 34  29 3d 2b 31 3a 6c 65 67  |galdx%(4)=+1:leg|
000007c0  61 6c 64 79 25 28 34 29  3d 2b 32 0d 02 94 22 20  |aldy%(4)=+2..." |
000007d0  6c 65 67 61 6c 64 78 25  28 35 29 3d 2d 32 3a 6c  |legaldx%(5)=-2:l|
000007e0  65 67 61 6c 64 79 25 28  35 29 3d 2d 31 0d 02 9e  |egaldy%(5)=-1...|
000007f0  22 20 6c 65 67 61 6c 64  78 25 28 36 29 3d 2b 32  |" legaldx%(6)=+2|
00000800  3a 6c 65 67 61 6c 64 79  25 28 36 29 3d 2d 31 0d  |:legaldy%(6)=-1.|
00000810  02 a8 22 20 6c 65 67 61  6c 64 78 25 28 37 29 3d  |.." legaldx%(7)=|
00000820  2d 32 3a 6c 65 67 61 6c  64 79 25 28 37 29 3d 2b  |-2:legaldy%(7)=+|
00000830  31 0d 02 b2 22 20 6c 65  67 61 6c 64 78 25 28 38  |1..." legaldx%(8|
00000840  29 3d 2b 32 3a 6c 65 67  61 6c 64 79 25 28 38 29  |)=+2:legaldy%(8)|
00000850  3d 2b 31 0d 02 bc 06 20  e1 0d 02 c6 05 3a 0d 02  |=+1.... .....:..|
00000860  d0 0b 20 dd f2 6d 65 6e  75 0d 02 da 18 20 fb 31  |.. ..menu.... .1|
00000870  3a ef 32 38 2c 32 36 2c  31 38 2c 33 39 2c 34 3a  |:.28,26,18,39,4:|
00000880  db 0d 02 e4 23 20 e7 78  73 74 61 72 74 25 3e 78  |....# .xstart%>x|
00000890  73 69 7a 65 25 20 78 73  74 61 72 74 25 3d 78 73  |size% xstart%=xs|
000008a0  69 7a 65 25 0d 02 ee 23  20 e7 79 73 74 61 72 74  |ize%...# .ystart|
000008b0  25 3e 79 73 69 7a 65 25  20 79 73 74 61 72 74 25  |%>ysize% ystart%|
000008c0  3d 79 73 69 7a 65 25 0d  02 f8 5c 20 f1 22 31 29  |=ysize%...\ ."1)|
000008d0  20 78 20 73 69 7a 65 20  22 3b 78 73 69 7a 65 25  | x size ";xsize%|
000008e0  27 27 22 32 29 20 79 20  73 69 7a 65 20 22 3b 79  |''"2) y size ";y|
000008f0  73 69 7a 65 25 27 27 22  33 29 20 78 20 73 74 61  |size%''"3) x sta|
00000900  72 74 20 22 3b 78 73 74  61 72 74 25 27 27 22 34  |rt ";xstart%''"4|
00000910  29 20 79 20 73 74 61 72  74 20 22 3b 79 73 74 61  |) y start ";ysta|
00000920  72 74 25 0d 03 02 06 20  e1 0d 03 0c 05 3a 0d 03  |rt%.... .....:..|
00000930  16 0c 20 dd f2 62 6f 61  72 64 0d 03 20 22 20 ef  |.. ..board.. " .|
00000940  32 38 2c 30 2c 32 36 2c  32 35 2c 32 3a db 3a ef  |28,0,26,25,2:.:.|
00000950  32 38 2c 30 2c 32 37 2c  32 35 2c 33 0d 03 2a 08  |28,0,27,25,3..*.|
00000960  20 fb 20 33 0d 03 34 15  20 e3 79 25 3d 30 20 b8  | . 3..4. .y%=0 .|
00000970  20 79 73 69 7a 65 25 2d  31 0d 03 3e 79 20 e7 28  | ysize%-1..>y .(|
00000980  79 25 83 32 3d 30 20 84  20 78 73 69 7a 65 25 3c  |y%.2=0 . xsize%<|
00000990  3e 31 29 20 8c 20 e3 78  25 3d 28 79 25 83 32 29  |>1) . .x%=(y%.2)|
000009a0  20 b8 20 78 73 69 7a 65  25 2d 31 20 88 20 32 3a  | . xsize%-1 . 2:|
000009b0  f1 8a 78 25 2a 33 2b 31  2c 79 25 2a 33 29 3b 77  |..x%*3+1,y%*3);w|
000009c0  24 3b 8a 30 2c 79 25 2a  33 2b 31 29 3b 79 73 69  |$;.0,y%*3+1);ysi|
000009d0  7a 65 25 2d 79 25 3b 3a  ed 20 8b 20 f1 8a 30 2c  |ze%-y%;:. . ..0,|
000009e0  79 25 2a 33 2b 31 29 3b  79 73 69 7a 65 25 2d 79  |y%*3+1);ysize%-y|
000009f0  25 3b 0d 03 48 06 20 ed  0d 03 52 2c 20 e3 78 25  |%;..H. ...R, .x%|
00000a00  3d 31 20 b8 20 78 73 69  7a 65 25 3a f1 8a 78 25  |=1 . xsize%:..x%|
00000a10  2a 33 2d 31 2c 79 73 69  7a 65 25 2a 33 29 3b 78  |*3-1,ysize%*3);x|
00000a20  25 3b 3a ed 0d 03 5c 1e  20 ec 32 38 2c 39 32 38  |%;:...\. .28,928|
00000a30  3a df 78 73 69 7a 65 25  2a 39 36 2b 33 32 2c 39  |:.xsize%*96+32,9|
00000a40  32 38 0d 03 66 21 20 df  20 78 73 69 7a 65 25 2a  |28..f! . xsize%*|
00000a50  39 36 2b 33 32 2c 39 32  34 2d 79 73 69 7a 65 25  |96+32,924-ysize%|
00000a60  2a 39 36 0d 03 70 20 20  df 20 32 38 2c 39 32 34  |*96..p  . 28,924|
00000a70  2d 79 73 69 7a 65 25 2a  39 36 3a df 20 32 38 2c  |-ysize%*96:. 28,|
00000a80  39 32 38 0d 03 7a 51 20  e7 20 28 79 73 69 7a 65  |928..zQ . (ysize|
00000a90  25 2d 79 73 74 61 72 74  25 29 83 32 3c 3e 30 20  |%-ystart%).2<>0 |
00000aa0  8c 20 62 6c 6b 73 71 72  25 3d 28 28 78 73 74 61  |. blksqr%=((xsta|
00000ab0  72 74 25 83 32 29 3c 3e  30 29 20 8b 20 62 6c 6b  |rt%.2)<>0) . blk|
00000ac0  73 71 72 25 3d 28 28 78  73 74 61 72 74 25 83 32  |sqr%=((xstart%.2|
00000ad0  29 3d 30 29 0d 03 84 1c  20 f2 70 6c 6f 74 4b 28  |)=0).... .plotK(|
00000ae0  78 73 74 61 72 74 25 2c  79 73 74 61 72 74 25 29  |xstart%,ystart%)|
00000af0  0d 03 8e 2e 20 f1 8a 28  78 73 74 61 72 74 25 2d  |.... ..(xstart%-|
00000b00  31 29 2a 33 2b 31 2c 28  79 73 69 7a 65 25 2d 79  |1)*3+1,(ysize%-y|
00000b10  73 74 61 72 74 25 29 2a  33 29 3b 6b 24 3b 0d 03  |start%)*3);k$;..|
00000b20  98 1b 20 fb 31 32 38 3a  ef 32 38 2c 32 36 2c 32  |.. .128:.28,26,2|
00000b30  35 2c 33 39 2c 31 34 3a  db 0d 03 a2 06 20 e1 0d  |5,39,14:..... ..|
00000b40  03 ac 05 3a 0d 03 b6 0b  20 dd f2 68 65 6c 70 0d  |...:.... ..help.|
00000b50  03 c0 13 20 ef 32 38 2c  30 2c 33 31 2c 33 39 2c  |... .28,0,31,39,|
00000b60  32 39 0d 03 ca 0e 20 fb  31 32 38 3a fb 31 3a db  |29.... .128:.1:.|
00000b70  0d 03 d4 62 20 f1 22 43  20 2d 20 63 6f 6e 74 69  |...b ."C - conti|
00000b80  6e 75 6f 75 73 20 73 65  61 72 63 68 20 66 6f 72  |nuous search for|
00000b90  20 73 6f 6c 75 74 69 6f  6e 2e 22 27 22 53 20 2d  | solution."'"S -|
00000ba0  20 73 69 6e 67 6c 65 20  73 74 65 70 2e 22 27 22  | single step."'"|
00000bb0  52 20 2d 20 72 65 73 74  61 72 74 20 77 69 74 68  |R - restart with|
00000bc0  20 6e 65 77 20 70 61 72  61 6d 65 74 65 72 73 2e  | new parameters.|
00000bd0  22 3b 0d 03 de 06 20 e1  0d 03 e8 05 3a 0d 03 f2  |";.... .....:...|
00000be0  1e 20 dd a4 74 72 79 6d  6f 76 65 28 6d 6f 76 65  |. ..trymove(move|
00000bf0  6e 75 6d 25 2c 78 25 2c  79 25 29 0d 03 fc 24 20  |num%,x%,y%)...$ |
00000c00  f4 20 74 68 65 20 6d 61  69 6e 20 72 65 63 75 72  |. the main recur|
00000c10  73 69 76 65 20 70 72 6f  63 65 64 75 72 65 21 0d  |sive procedure!.|
00000c20  04 06 21 20 ea 20 74 72  79 6e 75 6d 62 65 72 25  |..! . trynumber%|
00000c30  2c 67 6f 6f 64 6d 6f 76  65 25 2c 69 25 2c 6a 25  |,goodmove%,i%,j%|
00000c40  0d 04 10 11 20 74 72 79  6e 75 6d 62 65 72 25 3d  |.... trynumber%=|
00000c50  30 0d 04 1a 10 20 f4 20  6d 61 69 6e 20 6c 6f 6f  |0.... . main loo|
00000c60  70 0d 04 24 20 20 74 72  79 6e 75 6d 62 65 72 25  |p..$  trynumber%|
00000c70  20 3d 20 74 72 79 6e 75  6d 62 65 72 25 20 2b 20  | = trynumber% + |
00000c80  31 0d 04 2e 12 20 67 6f  6f 64 6d 6f 76 65 25 20  |1.... goodmove% |
00000c90  3d 20 a3 0d 04 38 23 20  69 25 20 3d 20 78 25 20  |= ...8# i% = x% |
00000ca0  2b 20 6c 65 67 61 6c 64  78 25 28 74 72 79 6e 75  |+ legaldx%(trynu|
00000cb0  6d 62 65 72 25 29 0d 04  42 23 20 6a 25 20 3d 20  |mber%)..B# j% = |
00000cc0  79 25 20 2b 20 6c 65 67  61 6c 64 79 25 28 74 72  |y% + legaldy%(tr|
00000cd0  79 6e 75 6d 62 65 72 25  29 0d 04 4c 39 20 e7 20  |ynumber%)..L9 . |
00000ce0  ac 20 28 69 25 3e 30 20  80 20 69 25 3c 3d 78 73  |. (i%>0 . i%<=xs|
00000cf0  69 7a 65 25 20 80 20 6a  25 3e 30 20 80 20 6a 25  |ize% . j%>0 . j%|
00000d00  3c 3d 79 73 69 7a 65 25  29 20 8c 20 e5 20 8d 44  |<=ysize%) . . .D|
00000d10  74 44 0d 04 56 24 20 f4  20 70 72 6f 70 6f 73 65  |tD..V$ . propose|
00000d20  64 20 6d 6f 76 65 20 69  73 20 6f 6e 20 74 68 65  |d move is on the|
00000d30  20 62 6f 61 72 64 0d 04  60 97 20 e7 20 62 6f 61  | board..`. . boa|
00000d40  72 64 25 28 69 25 2c 6a  25 29 3d 30 20 8c 20 62  |rd%(i%,j%)=0 . b|
00000d50  6f 61 72 64 25 28 69 25  2c 6a 25 29 3d 6d 6f 76  |oard%(i%,j%)=mov|
00000d60  65 6e 75 6d 25 3a f2 70  6c 6f 74 4b 28 69 25 2c  |enum%:.plotK(i%,|
00000d70  6a 25 29 3a 67 6f 6f 64  6d 6f 76 65 25 3d a4 74  |j%):goodmove%=.t|
00000d80  72 79 6d 6f 76 65 28 6d  6f 76 65 6e 75 6d 25 2b  |rymove(movenum%+|
00000d90  31 2c 69 25 2c 6a 25 29  3a e7 20 ac 28 67 6f 6f  |1,i%,j%):. .(goo|
00000da0  64 6d 6f 76 65 25 29 20  8c 20 62 6f 61 72 64 25  |dmove%) . board%|
00000db0  28 69 25 2c 6a 25 29 3d  30 3a f2 75 6e 64 6f 4b  |(i%,j%)=0:.undoK|
00000dc0  28 69 25 2c 6a 25 2c 78  25 2c 79 25 29 0d 04 6a  |(i%,j%,x%,y%)..j|
00000dd0  3e 20 e7 20 6d 6f 76 65  6e 75 6d 25 3d 78 73 69  |> . movenum%=xsi|
00000de0  7a 65 25 2a 79 73 69 7a  65 25 2b 31 20 8c 20 67  |ze%*ysize%+1 . g|
00000df0  6f 6f 64 6d 6f 76 65 25  3d b9 3a f4 20 66 6f 75  |oodmove%=.:. fou|
00000e00  6e 64 20 73 6f 6c 75 74  69 6f 6e 0d 04 74 15 20  |nd solution..t. |
00000e10  f4 20 6c 61 62 65 6c 20  66 6f 72 20 67 6f 74 6f  |. label for goto|
00000e20  0d 04 7e 55 20 e7 20 ac  28 67 6f 6f 64 6d 6f 76  |..~U . .(goodmov|
00000e30  65 25 20 84 20 28 74 72  79 6e 75 6d 62 65 72 25  |e% . (trynumber%|
00000e40  3d 38 29 29 20 e5 20 8d  54 5a 44 3a f4 20 6c 6f  |=8)) . .TZD:. lo|
00000e50  6f 70 20 75 6e 74 69 6c  20 66 69 6e 69 73 68 65  |op until finishe|
00000e60  64 20 6f 72 20 61 6c 6c  20 6d 6f 76 65 73 20 74  |d or all moves t|
00000e70  72 69 65 64 2e 0d 04 88  0f 20 3d 67 6f 6f 64 6d  |ried..... =goodm|
00000e80  6f 76 65 25 0d 04 92 05  3a 0d 04 9c 13 20 dd f2  |ove%....:.... ..|
00000e90  70 6c 6f 74 4b 28 78 25  2c 79 25 29 0d 04 a6 16  |plotK(x%,y%)....|
00000ea0  20 f2 74 72 79 6b 65 79  73 28 78 25 2c 79 25 2c  | .trykeys(x%,y%,|
00000eb0  a3 29 0d 04 b0 15 20 ef  32 36 3b 32 38 2c 30 2c  |.).... .26;28,0,|
00000ec0  32 36 2c 32 35 2c 33 0d  04 ba 36 20 e7 20 62 6c  |26,25,3...6 . bl|
00000ed0  6b 73 71 72 25 20 fb 31  32 38 3a fb 33 3a 6b 24  |ksqr% .128:.3:k$|
00000ee0  3d 62 6c 61 63 6b 6b 24  20 8b 20 fb 31 33 31 3a  |=blackk$ . .131:|
00000ef0  fb 30 3a 6b 24 3d 77 68  69 74 65 6b 24 0d 04 c4  |.0:k$=whitek$...|
00000f00  15 20 62 6c 6b 73 71 72  25 3d ac 62 6c 6b 73 71  |. blksqr%=.blksq|
00000f10  72 25 0d 04 ce 24 20 f1  8a 28 78 25 2d 31 29 2a  |r%...$ ..(x%-1)*|
00000f20  33 2b 31 2c 28 79 73 69  7a 65 25 2d 79 25 29 2a  |3+1,(ysize%-y%)*|
00000f30  33 29 3b 6b 24 3b 0d 04  d8 06 20 e1 0d 04 e2 05  |3);k$;.... .....|
00000f40  3a 0d 04 ec 1f 20 dd f2  75 6e 64 6f 4b 28 78 25  |:.... ..undoK(x%|
00000f50  2c 79 25 2c 6f 6c 64 78  25 2c 6f 6c 64 79 25 29  |,y%,oldx%,oldy%)|
00000f60  0d 04 f6 1c 20 f2 74 72  79 6b 65 79 73 28 6f 6c  |.... .trykeys(ol|
00000f70  64 78 25 2c 6f 6c 64 79  25 2c b9 29 0d 05 00 15  |dx%,oldy%,.)....|
00000f80  20 62 6c 6b 73 71 72 25  3d ac 62 6c 6b 73 71 72  | blksqr%=.blksqr|
00000f90  25 0d 05 0a 16 20 e7 20  62 6c 6b 73 71 72 25 20  |%.... . blksqr% |
00000fa0  fb 30 20 8b 20 fb 33 0d  05 14 24 20 f1 8a 28 78  |.0 . .3...$ ..(x|
00000fb0  25 2d 31 29 2a 33 2b 31  2c 28 79 73 69 7a 65 25  |%-1)*3+1,(ysize%|
00000fc0  2d 79 25 29 2a 33 29 3b  77 24 3b 0d 05 1e 06 20  |-y%)*3);w$;.... |
00000fd0  e1 0d 05 28 05 3a 0d 05  32 20 20 dd f2 74 72 79  |...(.:..2  ..try|
00000fe0  6b 65 79 73 28 78 25 2c  79 25 2c 62 61 63 6b 74  |keys(x%,y%,backt|
00000ff0  72 61 63 6b 25 29 0d 05  3c 0c 20 2a 46 58 31 35  |rack%)..<. *FX15|
00001000  2c 30 0d 05 46 39 20 e7  20 28 63 6f 6e 74 25 20  |,0..F9 . (cont% |
00001010  80 20 ac 28 a6 28 2d 38  32 29 29 20 80 20 ac 28  |. .(.(-82)) . .(|
00001020  a6 28 2d 35 32 29 29 29  20 8c 20 6b 65 79 24 3d  |.(-52))) . key$=|
00001030  22 22 20 8b 20 6b 65 79  24 3d be 0d 05 50 19 20  |"" . key$=...P. |
00001040  e7 20 6b 65 79 24 3d 22  43 22 20 8c 20 63 6f 6e  |. key$="C" . con|
00001050  74 25 3d b9 0d 05 5a 19  20 e7 20 6b 65 79 24 3d  |t%=...Z. . key$=|
00001060  22 53 22 20 8c 20 63 6f  6e 74 25 3d a3 0d 05 64  |"S" . cont%=...d|
00001070  13 20 e7 20 6b 65 79 24  3d 22 52 22 20 8c 20 f9  |. . key$="R" . .|
00001080  0d 05 6e 1f 20 ef 32 38  2c 32 36 2c 32 35 2c 33  |..n. .28,26,25,3|
00001090  39 2c 31 34 3b 33 31 2c  30 2c 31 30 3b 31 30 0d  |9,14;31,0,10;10.|
000010a0  05 78 0c 20 fb 31 32 38  3a fb 33 0d 05 82 27 20  |.x. .128:.3...' |
000010b0  e7 20 62 61 63 6b 74 72  61 63 6b 25 20 8c 20 f1  |. backtrack% . .|
000010c0  22 62 61 63 6b 22 3b 20  8b 20 f1 22 6d 6f 76 65  |"back"; . ."move|
000010d0  22 3b 0d 05 8c 16 20 f1  22 20 74 6f 20 22 3b 78  |";.... ." to ";x|
000010e0  25 3b 22 2c 22 3b 79 25  0d 05 96 12 20 ef 32 38  |%;",";y%.... .28|
000010f0  2c 30 2c 32 36 2c 32 35  2c 33 0d 05 a0 06 20 e1  |,0,26,25,3.... .|
00001100  0d 05 aa 05 3a 0d 05 b4  0c 20 dd f2 73 74 61 72  |....:.... ..star|
00001110  74 0d 05 be 0c 20 fb 31  32 38 3a fb 31 0d 05 c8  |t.... .128:.1...|
00001120  06 20 f5 0d 05 d2 15 20  ef 32 38 2c 30 2c 33 31  |. ..... .28,0,31|
00001130  2c 33 39 2c 32 39 3a db  0d 05 dc 57 20 f1 22 45  |,39,29:....W ."E|
00001140  6e 74 65 72 20 6f 70 74  69 6f 6e 20 74 6f 20 62  |nter option to b|
00001150  65 20 63 68 61 6e 67 65  64 3b 20 35 20 74 6f 20  |e changed; 5 to |
00001160  73 74 61 72 74 22 3a 6b  65 79 25 3d a5 2d 34 38  |start":key%=.-48|
00001170  3a e7 6b 65 79 25 3d 35  20 84 6b 65 79 25 3c 31  |:.key%=5 .key%<1|
00001180  20 84 20 6b 65 79 25 3e  35 20 e5 8d 54 76 46 0d  | . key%>5 ..TvF.|
00001190  05 e6 10 20 f1 22 43 68  61 6e 67 65 20 22 3b 0d  |... ."Change ";.|
000011a0  05 f0 55 20 e7 6b 65 79  25 3d 31 20 f1 22 78 20  |..U .key%=1 ."x |
000011b0  73 69 7a 65 22 3b 20 8b  e7 6b 65 79 25 3d 32 20  |size"; ..key%=2 |
000011c0  f1 22 79 20 73 69 7a 65  22 3b 20 8b e7 6b 65 79  |."y size"; ..key|
000011d0  25 3d 33 20 f1 22 78 20  73 74 61 72 74 22 3b 20  |%=3 ."x start"; |
000011e0  8b e7 6b 65 79 25 3d 34  20 f1 22 79 20 73 74 61  |..key%=4 ."y sta|
000011f0  72 74 22 3b 0d 05 fa 0e  20 f1 22 20 74 6f 20 3f  |rt";.... ." to ?|
00001200  22 3b 0d 06 04 15 20 6f  70 74 25 3d a5 2d 34 38  |";.... opt%=.-48|
00001210  3a f1 3b 6f 70 74 25 0d  06 0e 21 20 e7 20 6f 70  |:.;opt%...! . op|
00001220  74 25 3c 31 20 84 20 6f  70 74 25 3e 38 20 8c 20  |t%<1 . opt%>8 . |
00001230  ef 37 3a e5 8d 54 76 46  0d 06 18 26 20 e7 20 6b  |.7:..TvF...& . k|
00001240  65 79 25 3d 33 20 80 20  6f 70 74 25 3e 78 73 69  |ey%=3 . opt%>xsi|
00001250  7a 65 25 20 8c 20 ef 37  3a e5 8d 54 76 46 0d 06  |ze% . .7:..TvF..|
00001260  22 26 20 e7 20 6b 65 79  25 3d 34 20 80 20 6f 70  |"& . key%=4 . op|
00001270  74 25 3e 79 73 69 7a 65  25 20 8c 20 ef 37 3a e5  |t%>ysize% . .7:.|
00001280  8d 54 76 46 0d 06 2c 5a  20 e7 20 6b 65 79 25 3d  |.TvF..,Z . key%=|
00001290  31 20 78 73 69 7a 65 25  3d 6f 70 74 25 20 8b e7  |1 xsize%=opt% ..|
000012a0  6b 65 79 25 3d 32 20 79  73 69 7a 65 25 3d 6f 70  |key%=2 ysize%=op|
000012b0  74 25 20 8b e7 6b 65 79  25 3d 33 20 78 73 74 61  |t% ..key%=3 xsta|
000012c0  72 74 25 3d 6f 70 74 25  20 8b e7 6b 65 79 25 3d  |rt%=opt% ..key%=|
000012d0  34 20 79 73 74 61 72 74  25 3d 6f 70 74 25 0d 06  |4 ystart%=opt%..|
000012e0  36 0a 20 f2 6d 65 6e 75  0d 06 40 0d 20 fd 20 6b  |6. .menu..@. . k|
000012f0  65 79 25 3d 35 0d 06 4a  19 20 63 6f 6e 74 25 3d  |ey%=5..J. cont%=|
00001300  b9 3a f2 62 6f 61 72 64  3a f2 68 65 6c 70 0d 06  |.:.board:.help..|
00001310  54 06 20 e1 0d 06 5e 05  3a 0d 06 68 10 20 dd f2  |T. ...^.:..h. ..|
00001320  6f 75 74 70 75 74 61 6e  73 0d 06 72 25 20 f1 22  |outputans..r% ."|
00001330  53 74 61 72 74 20 61 74  20 22 3b 78 73 74 61 72  |Start at ";xstar|
00001340  74 25 3b 22 2c 22 3b 79  73 74 61 72 74 25 0d 06  |t%;",";ystart%..|
00001350  7c 1f 20 e3 6d 6f 76 65  25 3d 32 20 b8 20 28 78  ||. .move%=2 . (x|
00001360  73 69 7a 65 25 2a 79 73  69 7a 65 25 29 0d 06 86  |size%*ysize%)...|
00001370  0e 20 78 25 3d 30 3a 79  25 3d 31 0d 06 90 06 20  |. x%=0:y%=1.... |
00001380  f5 0d 06 9a 28 20 78 25  3d 78 25 2b 31 3a e7 78  |....( x%=x%+1:.x|
00001390  25 3d 78 73 69 7a 65 25  2b 31 20 8c 20 78 25 3d  |%=xsize%+1 . x%=|
000013a0  31 3a 79 25 3d 79 25 2b  31 0d 06 a4 19 20 fd 62  |1:y%=y%+1.... .b|
000013b0  6f 61 72 64 25 28 78 25  2c 79 25 29 3d 6d 6f 76  |oard%(x%,y%)=mov|
000013c0  65 25 0d 06 ae 1a 20 f1  22 4d 6f 76 65 20 74 6f  |e%.... ."Move to|
000013d0  20 22 3b 78 25 3b 22 2c  22 3b 79 25 0d 06 b8 06  | ";x%;",";y%....|
000013e0  20 ed 0d 06 c2 06 20 e1  0d 06 cc 05 3a 0d 06 d6  | ..... .....:...|
000013f0  10 20 dd a4 64 69 73 63  65 72 72 6f 72 0d 06 e0  |. ..discerror...|
00001400  16 20 fb 31 32 38 3a fb  79 65 6c 6c 6f 77 25 3a  |. .128:.yellow%:|
00001410  f6 3a f1 0d 06 ea 6d 20  e7 20 9f 3d 32 31 38 20  |.:....m . .=218 |
00001420  84 20 9f 3d 32 32 32 20  84 20 9f 3d 32 31 36 20  |. .=222 . .=216 |
00001430  84 20 9f 3d 32 32 33 20  84 20 9f 3d 32 31 39 20  |. .=223 . .=219 |
00001440  84 20 9f 3d 32 31 37 20  84 20 9f 3d 32 31 34 20  |. .=217 . .=214 |
00001450  84 20 9f 3d 32 30 34 20  84 20 9f 3d 31 39 31 20  |. .=204 . .=191 |
00001460  8c 20 f1 22 70 72 65 73  73 20 73 70 61 63 65 2d  |. ."press space-|
00001470  62 61 72 22 3a f5 fd be  3d 22 20 22 3a 20 3d b9  |bar":...=" ": =.|
00001480  0d 06 f4 07 20 3d a3 0d  ff                       |.... =...|
00001489
14-07-89/BKnight.m0
14-07-89/BKnight.m1
14-07-89/BKnight.m2
14-07-89/BKnight.m4
14-07-89/BKnight.m5