Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF » G/HANOI
G/HANOI
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/HANOI |
Read OK: | ✔ |
File size: | 0C62 bytes |
Load address: | FFFF0E00 |
Exec address: | FFFF802B |
Duplicates
There are 2 duplicate copies of this file in the archive:
- AEW website » headfirst » headfirst_5_25_discs_HeadFirst-PD-Disk-000_D-HD000.ssd » Hanoi
- AEW website » headfirst » headfirst_5_25_discs_HeadFirst-PD-Disk-010_D-HD010.ssd » Hanoi
- Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF » G/HANOI
File contents
10REM Tower Of Hanoy Patience 20REM (C) HeadFirst 1991 30REM By G Boden 35*FX200 40ON ERROR RUN 50MODE7 60PROCinit:PROCchars 70VDU23,1,0;0;0;0; 80PRINT CHR$141;CHR$134;CHR$157;CHR$132;SPC4;"TOWER OF HANOY PATIENCE";SPC6;CHR$156 90PRINT CHR$141;CHR$134;CHR$157;CHR$132;SPC4;"TOWER OF HANOY PATIENCE";SPC6;CHR$156 100PRINT'TAB(11);"(C) HeadFirst 1991" 110PRINT' 120PRINT"This is a game of pure skill. Only nine"'"cards are used; and are laid out in"'"three rows of three. The object is to"'"get them into a single column in"'"descending sequence by moving according"'"to the following rules:" 130PRINT'CHR$131;CHR$255;" One card only may be moved at a time" 140PRINTCHR$131;CHR$255;" It must be a card from the foot of a"'CHR$131;" column." 150PRINTCHR$131;CHR$255;" It can only be placed at the foot of"'CHR$131;" another column and below a higher"'CHR$131;" card." 160PRINT'"When a vacancy occurs (ie when all in"'"one column have been moved) the bottom"'"card of either of the remaining columns"'"may be used to fill the vacancy." 170PRINTTAB(13,24)CHR$134;"Press SPACE"; 180REPEAT UNTIL INKEY-99 190MODE1 200VDU19,2,2;0;23,1,0;0;0;0; 210COLOUR130:CLS 220DIM c%(3,15) 230DIM l%(3) 240FOR x%=1 TO 3 250FOR y%=1 TO 3 260READ c%(x%,y%) 270NEXT:l%(x%)=3:NEXT 280DATA &23,&63,&A3,&53,&73,&43,&33,&83,&93 290PROCtableau 300REPEAT 310COLOUR3:COLOUR130 320PRINTTAB(0,24)SPC(16) 330PRINTTAB(0,26)SPC(18) 340PRINTTAB(0,24)"Move from "; 350REPEAT f%=GET:f%=f%-48:UNTIL f%>0 AND f%<4:PRINT ;f%;" to "; 360REPEAT t%=GET:t%=t%-48:UNTIL t%>0 AND t%<4 AND t%<>f%:PRINT ;t% 370IF FNcheckmove=FALSE VDU7:PRINTTAB(0,26)"Move disallowed...":TIME=0:REPEAT UNTIL TIME>50:UNTIL0 380PROCmove(f%,t%) 390UNTIL FNcheckwon 400COLOUR0:COLOUR130:PRINTTAB(0,26)"Congratulations - you completed it...":TIME=0:REPEAT UNTIL TIME>200 410THIS IS TOWER OF HANOY PATIENCE BY GARETH BODEN (C) HF 1991. IT IS VERY DIFFICULT TO COMPLETE (I'VE NEVER DONE IT...!) 420DEFPROCtableau 430FOR x%=1 TO 3 440FOR y%=1 TO 3 450PROCf(c%(x%,y%),x%,y%) 460NEXT, 470COLOUR3:COLOUR130:PRINTTAB(8,1)"TOWER OF HANOY PATIENCE" 480FOR x%=1 TO 3:PRINT TAB(x%*4+11,4);x%:NEXT 490ENDPROC 500DEFFNcheckmove 510IF l%(f%)=0 =0 520=(c%(t%,l%(t%))-c%(f%,l%(f%))>0) OR (l%(t%)=0) 530DEFPROCmove(f%,t%) 540c%(t%,l%(t%)+1)=c%(f%,l%(f%)) 550l%(t%)=l%(t%)+1 560l%(f%)=l%(f%)-1 570PROCf(c%(f%,l%(f%)),f%,l%(f%)) 580PROCf(c%(t%,l%(t%)),t%,l%(t%)) 590ENDPROC 600DEFFNcheckwon 610=((l%(1)=9) OR (l%(2)=9) OR (l%(3)=9)) 620DEFPROCchars 630VDU23,224,54,127,127,127,62,28,8,0 640VDU23,225,8,28,62,127,127,127,28,62 650VDU23,226,0,8,28,62,127,62,28,8 660VDU23,227,8,28,28,107,127,107,8,28 670VDU23,228,&66,&CC,&99,&33,&66,&CC,&99,&33 680VDU23,229,78,91,81,81,81,91,78,0 690VDU23,230,0,&4C,&19,&33,&66,&4C,&19,&33 700VDU23,231,0,&CC,&99,&33,&66,&CC,&99,&33 710VDU23,232,0,&CC,&98,&32,&66,&CC,&98,&32 720VDU23,233,&66,&CC,&98,&32,&66,&CC,&98,&32 730VDU23,234,&66,&CC,&98,&32,&66,&CC,&98,0 740VDU23,235,&66,&CC,&99,&33,&66,&CC,&99,0 750VDU23,236,&66,&4C,&19,&33,&66,&4C,&19,0 760VDU23,237,&66,&4C,&19,&33,&66,&4C,&19,&33 770ENDPROC 780DEFPROCf(C%,x%,y%) 790x%=x%*4+10:y%=y%+5 800IF C%=0 FORI=0 TO 4:VDU31,x%,y%+I,32,32,32:NEXT:ENDPROC 810IF C% AND 1 COLOUR1 ELSE COLOUR0 820COLOUR131 830s%=(C% AND &F0)DIV16:v%=(C% AND &F):c$=CHR$(s%+48):IF s%=1 c$="A" ELSE IF s%=10 c$=CHR$(229) ELSE IF s%=11 c$="J" ELSE IF s%=12 c$="Q" ELSE IF s%=13 c$="K" 840c$=c$+" "+CHR$(v%+223) 850VDU31,x%,y%:PRINTc$ 860VDU31,x%,y%+1:PRINTSPC3 870VDU31,x%,y%+2:PRINTSPC3 880c$=RIGHT$(c$+" "+LEFT$(c$,1),3) 890VDU31,x%,y%+3:PRINTc$ 900COLOUR130 910VDU31,x%,y%+4:PRINTSPC3 920VDU31,x%,y%+5:PRINTSPC3 930ENDPROC 940: 950DEFPROCinit 960z$=CHR$(230)+CHR$(231)+CHR$(232) 970y$=CHR$230+CHR$231+CHR$232+CHR$10+CHR$8+CHR$8+CHR$8+CHR$237+CHR$228+CHR$233+CHR$10+CHR$8+CHR$8+CHR$8+CHR$237+CHR$228+CHR$233+CHR$10+CHR$8+CHR$8+CHR$8+CHR$236+CHR$235+CHR$234 980ENDPROC
� Tower Of Hanoy Patience � (C) HeadFirst 1991 � By G Boden # *FX200 ( � � � 2�7 <�init:�chars F�23,1,0;0;0;0; P>� �141;�134;�157;�132;�4;"TOWER OF HANOY PATIENCE";�6;�156 Z>� �141;�134;�157;�132;�4;"TOWER OF HANOY PATIENCE";�6;�156 d�'�11);"(C) HeadFirst 1991" n�' x��"This is a game of pure skill. Only nine"'"cards are used; and are laid out in"'"three rows of three. The object is to"'"get them into a single column in"'"descending sequence by moving according"'"to the following rules:" �7�'�131;�255;" One card only may be moved at a time" �G�131;�255;" It must be a card from the foot of a"'�131;" column." �p�131;�255;" It can only be placed at the foot of"'�131;" another column and below a higher"'�131;" card." ���'"When a vacancy occurs (ie when all in"'"one column have been moved) the bottom"'"card of either of the remaining columns"'"may be used to fill the vacancy." ��13,24)�134;"Press SPACE"; �� � �-99 ��1 ��19,2,2;0;23,1,0;0;0;0; � �130:� �� c%(3,15) �� l%(3) �� x%=1 � 3 �� y%=1 � 3 � c%(x%,y%) �:l%(x%)=3:� )� &23,&63,&A3,&53,&73,&43,&33,&83,&93 "�tableau ,� 6�3:�130 @�0,24)�(16) J�0,26)�(18) T�0,24)"Move from "; ^/� f%=�:f%=f%-48:� f%>0 � f%<4:� ;f%;" to "; h0� t%=�:t%=t%-48:� t%>0 � t%<4 � t%<>f%:� ;t% rA� �checkmove=� �7:�0,26)"Move disallowed...":�=0:� � �>50:�0 |�move(f%,t%) �� �checkwon �H�0:�130:�0,26)"Congratulations - you completed it...":�=0:� � �>200 �xTHIS IS �WER OF HANOY PATIENCE BY GARETH BODEN (C) HF 1991. IT IS VERY DIFFICULT � COMPLETE (I'VE NEVER DONE IT...!) � ��tableau �� x%=1 � 3 �� y%=1 � 3 ��f(c%(x%,y%),x%,y%) ��, �+�3:�130:�8,1)"TOWER OF HANOY PATIENCE" �!� x%=1 � 3:� �x%*4+11,4);x%:� �� �ݤcheckmove �� l%(f%)=0 =0 1=(c%(t%,l%(t%))-c%(f%,l%(f%))>0) � (l%(t%)=0) ��move(f%,t%) !c%(t%,l%(t%)+1)=c%(f%,l%(f%)) &l%(t%)=l%(t%)+1 0l%(f%)=l%(f%)-1 :�f(c%(f%,l%(f%)),f%,l%(f%)) D�f(c%(t%,l%(t%)),t%,l%(t%)) N� Xݤcheckwon b(=((l%(1)=9) � (l%(2)=9) � (l%(3)=9)) l��chars v$�23,224,54,127,127,127,62,28,8,0 �%�23,225,8,28,62,127,127,127,28,62 �!�23,226,0,8,28,62,127,62,28,8 �$�23,227,8,28,28,107,127,107,8,28 �+�23,228,&66,&CC,&99,&33,&66,&CC,&99,&33 �"�23,229,78,91,81,81,81,91,78,0 �)�23,230,0,&4C,&19,&33,&66,&4C,&19,&33 �)�23,231,0,&CC,&99,&33,&66,&CC,&99,&33 �)�23,232,0,&CC,&98,&32,&66,&CC,&98,&32 �+�23,233,&66,&CC,&98,&32,&66,&CC,&98,&32 �)�23,234,&66,&CC,&98,&32,&66,&CC,&98,0 �)�23,235,&66,&CC,&99,&33,&66,&CC,&99,0 �)�23,236,&66,&4C,&19,&33,&66,&4C,&19,0 �+�23,237,&66,&4C,&19,&33,&66,&4C,&19,&33 � ��f(C%,x%,y%) x%=x%*4+10:y%=y%+5 ,� C%=0 �I=0 � 4:�31,x%,y%+I,32,32,32:�:� *� C% � 1 �1 � �0 4�131 >�s%=(C% � &F0)�16:v%=(C% � &F):c$=�(s%+48):� s%=1 c$="A" � � s%=10 c$=�(229) � � s%=11 c$="J" � � s%=12 c$="Q" � � s%=13 c$="K" Hc$=c$+" "+�(v%+223) R�31,x%,y%:�c$ \�31,x%,y%+1:�3 f�31,x%,y%+2:�3 pc$=�c$+" "+�c$,1),3) z�31,x%,y%+3:�c$ ��130 ��31,x%,y%+4:�3 ��31,x%,y%+5:�3 �� �: � ��init �z$=�(230)+�(231)+�(232) �iy$=�230+�231+�232+�10+�8+�8+�8+�237+�228+�233+�10+�8+�8+�8+�237+�228+�233+�10+�8+�8+�8+�236+�235+�234 �� �
00000000 0d 00 0a 1d f4 20 54 6f 77 65 72 20 4f 66 20 48 |..... Tower Of H| 00000010 61 6e 6f 79 20 50 61 74 69 65 6e 63 65 0d 00 14 |anoy Patience...| 00000020 18 f4 20 28 43 29 20 48 65 61 64 46 69 72 73 74 |.. (C) HeadFirst| 00000030 20 31 39 39 31 0d 00 1e 10 f4 20 42 79 20 47 20 | 1991..... By G | 00000040 42 6f 64 65 6e 0d 00 23 0a 2a 46 58 32 30 30 0d |Boden..#.*FX200.| 00000050 00 28 09 ee 20 85 20 f9 0d 00 32 06 eb 37 0d 00 |.(.. . ...2..7..| 00000060 3c 10 f2 69 6e 69 74 3a f2 63 68 61 72 73 0d 00 |<..init:.chars..| 00000070 46 12 ef 32 33 2c 31 2c 30 3b 30 3b 30 3b 30 3b |F..23,1,0;0;0;0;| 00000080 0d 00 50 3e f1 20 bd 31 34 31 3b bd 31 33 34 3b |..P>. .141;.134;| 00000090 bd 31 35 37 3b bd 31 33 32 3b 89 34 3b 22 54 4f |.157;.132;.4;"TO| 000000a0 57 45 52 20 4f 46 20 48 41 4e 4f 59 20 50 41 54 |WER OF HANOY PAT| 000000b0 49 45 4e 43 45 22 3b 89 36 3b bd 31 35 36 0d 00 |IENCE";.6;.156..| 000000c0 5a 3e f1 20 bd 31 34 31 3b bd 31 33 34 3b bd 31 |Z>. .141;.134;.1| 000000d0 35 37 3b bd 31 33 32 3b 89 34 3b 22 54 4f 57 45 |57;.132;.4;"TOWE| 000000e0 52 20 4f 46 20 48 41 4e 4f 59 20 50 41 54 49 45 |R OF HANOY PATIE| 000000f0 4e 43 45 22 3b 89 36 3b bd 31 35 36 0d 00 64 1f |NCE";.6;.156..d.| 00000100 f1 27 8a 31 31 29 3b 22 28 43 29 20 48 65 61 64 |.'.11);"(C) Head| 00000110 46 69 72 73 74 20 31 39 39 31 22 0d 00 6e 06 f1 |First 1991"..n..| 00000120 27 0d 00 78 e3 f1 22 54 68 69 73 20 69 73 20 61 |'..x.."This is a| 00000130 20 67 61 6d 65 20 6f 66 20 70 75 72 65 20 73 6b | game of pure sk| 00000140 69 6c 6c 2e 20 4f 6e 6c 79 20 6e 69 6e 65 22 27 |ill. Only nine"'| 00000150 22 63 61 72 64 73 20 61 72 65 20 75 73 65 64 3b |"cards are used;| 00000160 20 61 6e 64 20 61 72 65 20 6c 61 69 64 20 6f 75 | and are laid ou| 00000170 74 20 69 6e 22 27 22 74 68 72 65 65 20 72 6f 77 |t in"'"three row| 00000180 73 20 6f 66 20 74 68 72 65 65 2e 20 54 68 65 20 |s of three. The | 00000190 6f 62 6a 65 63 74 20 69 73 20 74 6f 22 27 22 67 |object is to"'"g| 000001a0 65 74 20 74 68 65 6d 20 69 6e 74 6f 20 61 20 73 |et them into a s| 000001b0 69 6e 67 6c 65 20 63 6f 6c 75 6d 6e 20 69 6e 22 |ingle column in"| 000001c0 27 22 64 65 73 63 65 6e 64 69 6e 67 20 73 65 71 |'"descending seq| 000001d0 75 65 6e 63 65 20 62 79 20 6d 6f 76 69 6e 67 20 |uence by moving | 000001e0 61 63 63 6f 72 64 69 6e 67 22 27 22 74 6f 20 74 |according"'"to t| 000001f0 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 72 75 6c |he following rul| 00000200 65 73 3a 22 0d 00 82 37 f1 27 bd 31 33 31 3b bd |es:"...7.'.131;.| 00000210 32 35 35 3b 22 20 4f 6e 65 20 63 61 72 64 20 6f |255;" One card o| 00000220 6e 6c 79 20 6d 61 79 20 62 65 20 6d 6f 76 65 64 |nly may be moved| 00000230 20 61 74 20 61 20 74 69 6d 65 22 0d 00 8c 47 f1 | at a time"...G.| 00000240 bd 31 33 31 3b bd 32 35 35 3b 22 20 49 74 20 6d |.131;.255;" It m| 00000250 75 73 74 20 62 65 20 61 20 63 61 72 64 20 66 72 |ust be a card fr| 00000260 6f 6d 20 74 68 65 20 66 6f 6f 74 20 6f 66 20 61 |om the foot of a| 00000270 22 27 bd 31 33 31 3b 22 20 20 63 6f 6c 75 6d 6e |"'.131;" column| 00000280 2e 22 0d 00 96 70 f1 bd 31 33 31 3b bd 32 35 35 |."...p..131;.255| 00000290 3b 22 20 49 74 20 63 61 6e 20 6f 6e 6c 79 20 62 |;" It can only b| 000002a0 65 20 70 6c 61 63 65 64 20 61 74 20 74 68 65 20 |e placed at the | 000002b0 66 6f 6f 74 20 6f 66 22 27 bd 31 33 31 3b 22 20 |foot of"'.131;" | 000002c0 20 61 6e 6f 74 68 65 72 20 63 6f 6c 75 6d 6e 20 | another column | 000002d0 61 6e 64 20 62 65 6c 6f 77 20 61 20 68 69 67 68 |and below a high| 000002e0 65 72 22 27 bd 31 33 31 3b 22 20 20 63 61 72 64 |er"'.131;" card| 000002f0 2e 22 0d 00 a0 a3 f1 27 22 57 68 65 6e 20 61 20 |.".....'"When a | 00000300 76 61 63 61 6e 63 79 20 6f 63 63 75 72 73 20 28 |vacancy occurs (| 00000310 69 65 20 77 68 65 6e 20 61 6c 6c 20 69 6e 22 27 |ie when all in"'| 00000320 22 6f 6e 65 20 63 6f 6c 75 6d 6e 20 68 61 76 65 |"one column have| 00000330 20 62 65 65 6e 20 6d 6f 76 65 64 29 20 74 68 65 | been moved) the| 00000340 20 62 6f 74 74 6f 6d 22 27 22 63 61 72 64 20 6f | bottom"'"card o| 00000350 66 20 65 69 74 68 65 72 20 6f 66 20 74 68 65 20 |f either of the | 00000360 72 65 6d 61 69 6e 69 6e 67 20 63 6f 6c 75 6d 6e |remaining column| 00000370 73 22 27 22 6d 61 79 20 62 65 20 75 73 65 64 20 |s"'"may be used | 00000380 74 6f 20 66 69 6c 6c 20 74 68 65 20 76 61 63 61 |to fill the vaca| 00000390 6e 63 79 2e 22 0d 00 aa 1f f1 8a 31 33 2c 32 34 |ncy."......13,24| 000003a0 29 bd 31 33 34 3b 22 50 72 65 73 73 20 53 50 41 |).134;"Press SPA| 000003b0 43 45 22 3b 0d 00 b4 0c f5 20 fd 20 a6 2d 39 39 |CE";..... . .-99| 000003c0 0d 00 be 06 eb 31 0d 00 c8 1b ef 31 39 2c 32 2c |.....1.....19,2,| 000003d0 32 3b 30 3b 32 33 2c 31 2c 30 3b 30 3b 30 3b 30 |2;0;23,1,0;0;0;0| 000003e0 3b 0d 00 d2 0a fb 31 33 30 3a db 0d 00 dc 0e de |;.....130:......| 000003f0 20 63 25 28 33 2c 31 35 29 0d 00 e6 0b de 20 6c | c%(3,15)..... l| 00000400 25 28 33 29 0d 00 f0 0e e3 20 78 25 3d 31 20 b8 |%(3)..... x%=1 .| 00000410 20 33 0d 00 fa 0e e3 20 79 25 3d 31 20 b8 20 33 | 3..... y%=1 . 3| 00000420 0d 01 04 0f f3 20 63 25 28 78 25 2c 79 25 29 0d |..... c%(x%,y%).| 00000430 01 0e 10 ed 3a 6c 25 28 78 25 29 3d 33 3a ed 0d |....:l%(x%)=3:..| 00000440 01 18 29 dc 20 26 32 33 2c 26 36 33 2c 26 41 33 |..). &23,&63,&A3| 00000450 2c 26 35 33 2c 26 37 33 2c 26 34 33 2c 26 33 33 |,&53,&73,&43,&33| 00000460 2c 26 38 33 2c 26 39 33 0d 01 22 0c f2 74 61 62 |,&83,&93.."..tab| 00000470 6c 65 61 75 0d 01 2c 05 f5 0d 01 36 0b fb 33 3a |leau..,....6..3:| 00000480 fb 31 33 30 0d 01 40 10 f1 8a 30 2c 32 34 29 89 |.130..@...0,24).| 00000490 28 31 36 29 0d 01 4a 10 f1 8a 30 2c 32 36 29 89 |(16)..J...0,26).| 000004a0 28 31 38 29 0d 01 54 18 f1 8a 30 2c 32 34 29 22 |(18)..T...0,24)"| 000004b0 4d 6f 76 65 20 66 72 6f 6d 20 22 3b 0d 01 5e 2f |Move from ";..^/| 000004c0 f5 20 66 25 3d a5 3a 66 25 3d 66 25 2d 34 38 3a |. f%=.:f%=f%-48:| 000004d0 fd 20 66 25 3e 30 20 80 20 66 25 3c 34 3a f1 20 |. f%>0 . f%<4:. | 000004e0 3b 66 25 3b 22 20 74 6f 20 22 3b 0d 01 68 30 f5 |;f%;" to ";..h0.| 000004f0 20 74 25 3d a5 3a 74 25 3d 74 25 2d 34 38 3a fd | t%=.:t%=t%-48:.| 00000500 20 74 25 3e 30 20 80 20 74 25 3c 34 20 80 20 74 | t%>0 . t%<4 . t| 00000510 25 3c 3e 66 25 3a f1 20 3b 74 25 0d 01 72 41 e7 |%<>f%:. ;t%..rA.| 00000520 20 a4 63 68 65 63 6b 6d 6f 76 65 3d a3 20 ef 37 | .checkmove=. .7| 00000530 3a f1 8a 30 2c 32 36 29 22 4d 6f 76 65 20 64 69 |:..0,26)"Move di| 00000540 73 61 6c 6c 6f 77 65 64 2e 2e 2e 22 3a d1 3d 30 |sallowed...":.=0| 00000550 3a f5 20 fd 20 91 3e 35 30 3a fd 30 0d 01 7c 10 |:. . .>50:.0..|.| 00000560 f2 6d 6f 76 65 28 66 25 2c 74 25 29 0d 01 86 0f |.move(f%,t%)....| 00000570 fd 20 a4 63 68 65 63 6b 77 6f 6e 0d 01 90 48 fb |. .checkwon...H.| 00000580 30 3a fb 31 33 30 3a f1 8a 30 2c 32 36 29 22 43 |0:.130:..0,26)"C| 00000590 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e 73 20 2d |ongratulations -| 000005a0 20 79 6f 75 20 63 6f 6d 70 6c 65 74 65 64 20 69 | you completed i| 000005b0 74 2e 2e 2e 22 3a d1 3d 30 3a f5 20 fd 20 91 3e |t...":.=0:. . .>| 000005c0 32 30 30 0d 01 9a 78 54 48 49 53 20 49 53 20 b8 |200...xTHIS IS .| 000005d0 57 45 52 20 4f 46 20 48 41 4e 4f 59 20 50 41 54 |WER OF HANOY PAT| 000005e0 49 45 4e 43 45 20 42 59 20 47 41 52 45 54 48 20 |IENCE BY GARETH | 000005f0 42 4f 44 45 4e 20 28 43 29 20 48 46 20 31 39 39 |BODEN (C) HF 199| 00000600 31 2e 20 49 54 20 49 53 20 56 45 52 59 20 44 49 |1. IT IS VERY DI| 00000610 46 46 49 43 55 4c 54 20 b8 20 43 4f 4d 50 4c 45 |FFICULT . COMPLE| 00000620 54 45 20 28 49 27 56 45 20 4e 45 56 45 52 20 44 |TE (I'VE NEVER D| 00000630 4f 4e 45 20 49 54 2e 2e 2e 21 29 0d 01 a4 0d dd |ONE IT...!).....| 00000640 f2 74 61 62 6c 65 61 75 0d 01 ae 0e e3 20 78 25 |.tableau..... x%| 00000650 3d 31 20 b8 20 33 0d 01 b8 0e e3 20 79 25 3d 31 |=1 . 3..... y%=1| 00000660 20 b8 20 33 0d 01 c2 17 f2 66 28 63 25 28 78 25 | . 3.....f(c%(x%| 00000670 2c 79 25 29 2c 78 25 2c 79 25 29 0d 01 cc 06 ed |,y%),x%,y%).....| 00000680 2c 0d 01 d6 2b fb 33 3a fb 31 33 30 3a f1 8a 38 |,...+.3:.130:..8| 00000690 2c 31 29 22 54 4f 57 45 52 20 4f 46 20 48 41 4e |,1)"TOWER OF HAN| 000006a0 4f 59 20 50 41 54 49 45 4e 43 45 22 0d 01 e0 21 |OY PATIENCE"...!| 000006b0 e3 20 78 25 3d 31 20 b8 20 33 3a f1 20 8a 78 25 |. x%=1 . 3:. .x%| 000006c0 2a 34 2b 31 31 2c 34 29 3b 78 25 3a ed 0d 01 ea |*4+11,4);x%:....| 000006d0 05 e1 0d 01 f4 0f dd a4 63 68 65 63 6b 6d 6f 76 |........checkmov| 000006e0 65 0d 01 fe 11 e7 20 6c 25 28 66 25 29 3d 30 20 |e..... l%(f%)=0 | 000006f0 3d 30 0d 02 08 31 3d 28 63 25 28 74 25 2c 6c 25 |=0...1=(c%(t%,l%| 00000700 28 74 25 29 29 2d 63 25 28 66 25 2c 6c 25 28 66 |(t%))-c%(f%,l%(f| 00000710 25 29 29 3e 30 29 20 84 20 28 6c 25 28 74 25 29 |%))>0) . (l%(t%)| 00000720 3d 30 29 0d 02 12 11 dd f2 6d 6f 76 65 28 66 25 |=0)......move(f%| 00000730 2c 74 25 29 0d 02 1c 21 63 25 28 74 25 2c 6c 25 |,t%)...!c%(t%,l%| 00000740 28 74 25 29 2b 31 29 3d 63 25 28 66 25 2c 6c 25 |(t%)+1)=c%(f%,l%| 00000750 28 66 25 29 29 0d 02 26 13 6c 25 28 74 25 29 3d |(f%))..&.l%(t%)=| 00000760 6c 25 28 74 25 29 2b 31 0d 02 30 13 6c 25 28 66 |l%(t%)+1..0.l%(f| 00000770 25 29 3d 6c 25 28 66 25 29 2d 31 0d 02 3a 1f f2 |%)=l%(f%)-1..:..| 00000780 66 28 63 25 28 66 25 2c 6c 25 28 66 25 29 29 2c |f(c%(f%,l%(f%)),| 00000790 66 25 2c 6c 25 28 66 25 29 29 0d 02 44 1f f2 66 |f%,l%(f%))..D..f| 000007a0 28 63 25 28 74 25 2c 6c 25 28 74 25 29 29 2c 74 |(c%(t%,l%(t%)),t| 000007b0 25 2c 6c 25 28 74 25 29 29 0d 02 4e 05 e1 0d 02 |%,l%(t%))..N....| 000007c0 58 0e dd a4 63 68 65 63 6b 77 6f 6e 0d 02 62 28 |X...checkwon..b(| 000007d0 3d 28 28 6c 25 28 31 29 3d 39 29 20 84 20 28 6c |=((l%(1)=9) . (l| 000007e0 25 28 32 29 3d 39 29 20 84 20 28 6c 25 28 33 29 |%(2)=9) . (l%(3)| 000007f0 3d 39 29 29 0d 02 6c 0b dd f2 63 68 61 72 73 0d |=9))..l...chars.| 00000800 02 76 24 ef 32 33 2c 32 32 34 2c 35 34 2c 31 32 |.v$.23,224,54,12| 00000810 37 2c 31 32 37 2c 31 32 37 2c 36 32 2c 32 38 2c |7,127,127,62,28,| 00000820 38 2c 30 0d 02 80 25 ef 32 33 2c 32 32 35 2c 38 |8,0...%.23,225,8| 00000830 2c 32 38 2c 36 32 2c 31 32 37 2c 31 32 37 2c 31 |,28,62,127,127,1| 00000840 32 37 2c 32 38 2c 36 32 0d 02 8a 21 ef 32 33 2c |27,28,62...!.23,| 00000850 32 32 36 2c 30 2c 38 2c 32 38 2c 36 32 2c 31 32 |226,0,8,28,62,12| 00000860 37 2c 36 32 2c 32 38 2c 38 0d 02 94 24 ef 32 33 |7,62,28,8...$.23| 00000870 2c 32 32 37 2c 38 2c 32 38 2c 32 38 2c 31 30 37 |,227,8,28,28,107| 00000880 2c 31 32 37 2c 31 30 37 2c 38 2c 32 38 0d 02 9e |,127,107,8,28...| 00000890 2b ef 32 33 2c 32 32 38 2c 26 36 36 2c 26 43 43 |+.23,228,&66,&CC| 000008a0 2c 26 39 39 2c 26 33 33 2c 26 36 36 2c 26 43 43 |,&99,&33,&66,&CC| 000008b0 2c 26 39 39 2c 26 33 33 0d 02 a8 22 ef 32 33 2c |,&99,&33...".23,| 000008c0 32 32 39 2c 37 38 2c 39 31 2c 38 31 2c 38 31 2c |229,78,91,81,81,| 000008d0 38 31 2c 39 31 2c 37 38 2c 30 0d 02 b2 29 ef 32 |81,91,78,0...).2| 000008e0 33 2c 32 33 30 2c 30 2c 26 34 43 2c 26 31 39 2c |3,230,0,&4C,&19,| 000008f0 26 33 33 2c 26 36 36 2c 26 34 43 2c 26 31 39 2c |&33,&66,&4C,&19,| 00000900 26 33 33 0d 02 bc 29 ef 32 33 2c 32 33 31 2c 30 |&33...).23,231,0| 00000910 2c 26 43 43 2c 26 39 39 2c 26 33 33 2c 26 36 36 |,&CC,&99,&33,&66| 00000920 2c 26 43 43 2c 26 39 39 2c 26 33 33 0d 02 c6 29 |,&CC,&99,&33...)| 00000930 ef 32 33 2c 32 33 32 2c 30 2c 26 43 43 2c 26 39 |.23,232,0,&CC,&9| 00000940 38 2c 26 33 32 2c 26 36 36 2c 26 43 43 2c 26 39 |8,&32,&66,&CC,&9| 00000950 38 2c 26 33 32 0d 02 d0 2b ef 32 33 2c 32 33 33 |8,&32...+.23,233| 00000960 2c 26 36 36 2c 26 43 43 2c 26 39 38 2c 26 33 32 |,&66,&CC,&98,&32| * 00000980 0d 02 da 29 ef 32 33 2c 32 33 34 2c 26 36 36 2c |...).23,234,&66,| 00000990 26 43 43 2c 26 39 38 2c 26 33 32 2c 26 36 36 2c |&CC,&98,&32,&66,| 000009a0 26 43 43 2c 26 39 38 2c 30 0d 02 e4 29 ef 32 33 |&CC,&98,0...).23| 000009b0 2c 32 33 35 2c 26 36 36 2c 26 43 43 2c 26 39 39 |,235,&66,&CC,&99| 000009c0 2c 26 33 33 2c 26 36 36 2c 26 43 43 2c 26 39 39 |,&33,&66,&CC,&99| 000009d0 2c 30 0d 02 ee 29 ef 32 33 2c 32 33 36 2c 26 36 |,0...).23,236,&6| 000009e0 36 2c 26 34 43 2c 26 31 39 2c 26 33 33 2c 26 36 |6,&4C,&19,&33,&6| 000009f0 36 2c 26 34 43 2c 26 31 39 2c 30 0d 02 f8 2b ef |6,&4C,&19,0...+.| 00000a00 32 33 2c 32 33 37 2c 26 36 36 2c 26 34 43 2c 26 |23,237,&66,&4C,&| 00000a10 31 39 2c 26 33 33 2c 26 36 36 2c 26 34 43 2c 26 |19,&33,&66,&4C,&| 00000a20 31 39 2c 26 33 33 0d 03 02 05 e1 0d 03 0c 11 dd |19,&33..........| 00000a30 f2 66 28 43 25 2c 78 25 2c 79 25 29 0d 03 16 16 |.f(C%,x%,y%)....| 00000a40 78 25 3d 78 25 2a 34 2b 31 30 3a 79 25 3d 79 25 |x%=x%*4+10:y%=y%| 00000a50 2b 35 0d 03 20 2c e7 20 43 25 3d 30 20 e3 49 3d |+5.. ,. C%=0 .I=| 00000a60 30 20 b8 20 34 3a ef 33 31 2c 78 25 2c 79 25 2b |0 . 4:.31,x%,y%+| 00000a70 49 2c 33 32 2c 33 32 2c 33 32 3a ed 3a e1 0d 03 |I,32,32,32:.:...| 00000a80 2a 14 e7 20 43 25 20 80 20 31 20 fb 31 20 8b 20 |*.. C% . 1 .1 . | 00000a90 fb 30 0d 03 34 08 fb 31 33 31 0d 03 3e 82 73 25 |.0..4..131..>.s%| 00000aa0 3d 28 43 25 20 80 20 26 46 30 29 81 31 36 3a 76 |=(C% . &F0).16:v| 00000ab0 25 3d 28 43 25 20 80 20 26 46 29 3a 63 24 3d bd |%=(C% . &F):c$=.| 00000ac0 28 73 25 2b 34 38 29 3a e7 20 73 25 3d 31 20 63 |(s%+48):. s%=1 c| 00000ad0 24 3d 22 41 22 20 8b 20 e7 20 73 25 3d 31 30 20 |$="A" . . s%=10 | 00000ae0 63 24 3d bd 28 32 32 39 29 20 8b 20 e7 20 73 25 |c$=.(229) . . s%| 00000af0 3d 31 31 20 63 24 3d 22 4a 22 20 8b 20 e7 20 73 |=11 c$="J" . . s| 00000b00 25 3d 31 32 20 63 24 3d 22 51 22 20 8b 20 e7 20 |%=12 c$="Q" . . | 00000b10 73 25 3d 31 33 20 63 24 3d 22 4b 22 0d 03 48 17 |s%=13 c$="K"..H.| 00000b20 63 24 3d 63 24 2b 22 20 22 2b bd 28 76 25 2b 32 |c$=c$+" "+.(v%+2| 00000b30 32 33 29 0d 03 52 11 ef 33 31 2c 78 25 2c 79 25 |23)..R..31,x%,y%| 00000b40 3a f1 63 24 0d 03 5c 13 ef 33 31 2c 78 25 2c 79 |:.c$..\..31,x%,y| 00000b50 25 2b 31 3a f1 89 33 0d 03 66 13 ef 33 31 2c 78 |%+1:..3..f..31,x| 00000b60 25 2c 79 25 2b 32 3a f1 89 33 0d 03 70 18 63 24 |%,y%+2:..3..p.c$| 00000b70 3d c2 63 24 2b 22 20 22 2b c0 63 24 2c 31 29 2c |=.c$+" "+.c$,1),| 00000b80 33 29 0d 03 7a 13 ef 33 31 2c 78 25 2c 79 25 2b |3)..z..31,x%,y%+| 00000b90 33 3a f1 63 24 0d 03 84 08 fb 31 33 30 0d 03 8e |3:.c$.....130...| 00000ba0 13 ef 33 31 2c 78 25 2c 79 25 2b 34 3a f1 89 33 |..31,x%,y%+4:..3| 00000bb0 0d 03 98 13 ef 33 31 2c 78 25 2c 79 25 2b 35 3a |.....31,x%,y%+5:| 00000bc0 f1 89 33 0d 03 a2 05 e1 0d 03 ac 05 3a 0d 03 b6 |..3.........:...| 00000bd0 0a dd f2 69 6e 69 74 0d 03 c0 1b 7a 24 3d bd 28 |...init....z$=.(| 00000be0 32 33 30 29 2b bd 28 32 33 31 29 2b bd 28 32 33 |230)+.(231)+.(23| 00000bf0 32 29 0d 03 ca 69 79 24 3d bd 32 33 30 2b bd 32 |2)...iy$=.230+.2| 00000c00 33 31 2b bd 32 33 32 2b bd 31 30 2b bd 38 2b bd |31+.232+.10+.8+.| 00000c10 38 2b bd 38 2b bd 32 33 37 2b bd 32 32 38 2b bd |8+.8+.237+.228+.| 00000c20 32 33 33 2b bd 31 30 2b bd 38 2b bd 38 2b bd 38 |233+.10+.8+.8+.8| 00000c30 2b bd 32 33 37 2b bd 32 32 38 2b bd 32 33 33 2b |+.237+.228+.233+| 00000c40 bd 31 30 2b bd 38 2b bd 38 2b bd 38 2b bd 32 33 |.10+.8+.8+.8+.23| 00000c50 36 2b bd 32 33 35 2b bd 32 33 34 0d 03 d4 05 e1 |6+.235+.234.....| 00000c60 0d ff |..| 00000c62