Home » Personal collection » Acorn DFS disks » dfs_box03_disk06_games_4_backup.scp » OTHELLO
OTHELLO
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 DFS disks » dfs_box03_disk06_games_4_backup.scp |
Filename: | OTHELLO |
Read OK: | ✔ |
File size: | 0EAE bytes |
Load address: | FF1900 |
Exec address: | FF801F |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Acorn DFS disks » dfs_box03_disk06_games_4_backup.scp » OTHELLO
- Personal collection » Acorn DFS disks » dfs_box03_disk06b_games_4_backup.scp » OTHELLO
File contents
50DIMA%(9,9),I4%(8),J4%(8),D$(2),WT%(8,8),C$(8) 52 *TV0,1 55MODE4:VDU23;8202;0;0;0;:PRINTTAB(10,3);" " 57*FX16,0 60CLS:PRINTTAB(10,3);"-OTHELLO-" 280F2%=0 300RESTORE:PRINTTAB(4,7);"Do you want a difficult game "; 310S2%=0 320INPUTX$:IFLEFT$(X$,1)="N"THEN360 340IFLEFT$(X$,1)<>"Y"THEN320 350S2%=1 360B%=-1:W%=1:D$(B%+1)="X":D$(0+1)=" ":D$(W%+1)="O" 410FORK%=1TO8:READI4%(K%):NEXT 440DATA0,-1,-1,-1,0,1,1,1 450FORK%=1TO8:READJ4%(K%):NEXT 480DATA1,1,0,-1,-1,-1,0,1 481FORI%=1TO8:FORJ%=1TO8:READWT%(I%,J%):NEXT:NEXT 483DATA 38,0,24,25,25,24,0,38 484DATA 0,7,26,27,27,26,7,0 485DATA 24,26,28,28,28,28,26,24 486DATA 25,27,28,28,28,28,27,25 487DATA 25,27,28,28,28,28,27,25 488DATA 24,26,28,28,28,28,26,24 489DATA 0,7,26,27,27,26,7,0 490DATA 38,0,24,25,25,24,0,38 495FORK%=1TO8:READC$(K%):NEXT 520DATA"A","B","C","D","E","F","G","H" 540FORII%=0TO9:FORJ%=0TO9:A%(II%,J%)=0:NEXT:NEXT 590A%(4,4)=W%:A%(5,5)=W%:A%(4,5)=B%:A%(5,4)=B% 630C1%=2:H1%=2:N1%=4:Z%=0:PRINTTAB(4,9);"Do you want X or O "; 680C%=W%:H%=B% 700INPUTX$:IFX$="X"THEN750 720IFX$<>"O"ANDX$<>"0"THEN700 730C%=B%:H%=W% 750PRINTTAB(4,11);"Do you want to go first "; 760INPUTX$:IFLEFT$(X$,1)="N"THEN820 780IFLEFT$(X$,1)<>"Y"THEN760 790GOSUB2860:REM INIT. BOARD 800GOSUB2790:REM UPDAT. BOARD 810GOTO1320 820GOSUB2860:PRINTTAB(5,24);"Processing---":GOTO850 829REM MACHINES MOVE 830PRINTTAB(5,24);"Processing---":IFF2%=0THEN850 840INPUTX$ 850B1%=-1:I3%=0:J3%=0:T1%=C%:T2%=H%:FORI%=1TO8:FORJ%=1TO8 910IFA%(I%,J%)<>0THEN1080 920GOSUB2450:REM CHECK IF LEGAL MOVE 930IFF1%=0THEN1080 940U%=-1:GOSUB2540:REM CALC. VALUE OF MOVE 960IFS1%=0THEN1080 970IFS2%<>0THENS1%=S1%+WT%(I%,J%) 1010IFS1%<B1%THEN1080 1020IFS1%>B1%THEN1050 1030IFRND(2)=1THEN1080 1050B1%=S1%:REM BEST MOVE SO FAR 1060I3%=I%:J3%=J% 1080NEXT:NEXT:IFB1%>0THEN1150 1110PRINTTAB(5,26);"I MUST FORFEIT MY TURN "; 1120IFZ%=1THEN1930 1130Z%=1:GOTO1320 1150Z%=0:PRINTTAB(5,26);"My turn was: "; 1170PRINTC$(J3%);CHR$(I3%+48); 1190I%=I3%:J%=J3%:U%=1 1220GOSUB2540:REM CALC. VALUE OF MOVE 1230C1%=C1%+S1%+1:H1%=H1%-S1%:N1%=N1%+1 1260PRINTTAB(5,24);"I took ";S1%;" of your pieces.":PRINTTAB(16,28);" ":PRINTTAB(5,30);SPC(27) 1290GOSUB2790 1300IFH1%=0THEN1930 1310IF N1%=64THEN1930 1319REM PLAYERS MOVE 1320T1%=H%:T2%=C% 1340PRINTTAB(5,27);SPC(26):PRINTTAB(5,28);"Your turn: "; 1360INPUTZ$ 1370IFLEN(Z$)=2THEN1380ELSE1400 1380Z1%=ASC(LEFT$(Z$,1)):Z2%=ASC(MID$(Z$,2,1)) 1390IFZ1%>47ANDZ1%<57ANDZ2%>64ANDZ2%<73THEN1410 1395IFZ1%>64ANDZ1%<73ANDZ2%>47ANDZ2%<57THEN1410 1400PRINTTAB(5,30);"Bad input--try again. ":PRINTTAB(17,28);" ":GOTO1340 1410IFZ1%>57THEN1430 1420I%=Z1%-48:X$=CHR$(Z2%):GOTO1440 1430I%=Z2%-48:X$=CHR$(Z1%) 1440IFI%<0THEN1360 1450IFI%>8THEN1360 1460IFI%<>0THEN1570 1480PRINTTAB(5,27);"Are you stuck "; 1500INPUTX$ 1520IFLEN(X$)=0THEN1480 1530IFLEFT$(X$,1)<>"Y"THEN1340 1540IFZ%=1THEN1930 1550Z%=1:GOTO830 1570REM 1575J%=0:FORJJ%=1TO8:IFC$(JJ%)=LEFT$(X$,1)THENJ%=JJ% 1600NEXT 1610IFJ%=0THEN1360 1620IFA%(I%,J%)=0THEN1660 1630PRINTTAB(5,30);"Invalid move--try again. " 1650GOTO1340 1660GOSUB2450 1670IFF1%=1THEN1710 1680PRINTTAB(5,30);"Invalid move--try again. " 1700GOTO1340 1710U%=-1:GOSUB2540 1730IFS1%>0THEN1780 1740PRINTTAB(5,30);"Invalid move--try again. " 1760GOTO1340 1780Z%=0 1810PRINTTAB(5,30);"You took ";S1%;" of my pieces. ":PRINTTAB(5,24);SPC(26):PRINTTAB(5,26);SPC(26) 1840U%=1:GOSUB2540 1860H1%=H1%+S1%+1:C1%=C1%-S1%:N1%=N1%+1 1890GOSUB2790 1900IFC1%=0THEN1940:REM NO PIECES LEFT 1910IFN1%=64THEN1940:REM BOARD FULL 1920GOTO830 1930REM 1939REM *** END OF GAME 1940PRINTTAB(5,28);"You have ";H1%;" pieces.":PRINTTAB(5,30);"I have ";C1%;" pieces. " 2020IFH1%=C1%THEN2060 2030IFH1%>C1%THEN2080 2040PRINTTAB(5,26);"I WIN! " 2050GOTO2280 2060PRINTTAB(5,26);"DRAW!! ":GOTO2280 2080PRINTTAB(5,26);"YOU WIN! " 2280END 2449REM CHECK FOR LEGAL MOVE 2450F1%=0:FORI1%=-1TO1:FORJ1%=-1TO1 2480IFA%(I%+I1%,J%+J1%)=T2%THENF1%=1 2490NEXT:NEXT:RETURN 2540S1%=0:FORK%=1TO8:I5%=I4%(K%) 2570J5%=J4%(K%):I6%=I%+I5%:J6%=J%+J5%:S3%=0 2610IFA%(I6%,J6%)<>T2%THEN2770 2620S3%=S3%+1:I6%=I6%+I5%:J6%=J6%+J5% 2639REM CALCULATE VALUE OF MOVE 2650IFA%(I6%,J6%)=T1%THEN2680 2660IFA%(I6%,J6%)=0THEN2770 2670GOTO2620 2680S1%=S1%+S3%:IFU%<>1THEN2770 2700I6%=I%:J6%=J%:FORK1%=0TOS3%:A%(I6%,J6%)=T1%:I6%=I6%+I5%:J6%=J6%+J5%:NEXT 2770NEXT 2780RETURN 2789REM UPDATA BOARD 2790FORII%=1TO8:FORJ%=1TO8:PRINTTAB(4+3*II%,4+2*J%);D$(A%(II%,J%)+1):NEXT:NEXT:RETURN 2859REM INITIALISATION 2860CLS:FORN%=0TO8:MOVE189+N%*96,290:DRAW189+N%*96,900:MOVE125,N%*64+338:DRAW1025,N%*64+338:NEXT 2870FORN%=1TO8:PRINTTAB(4,4+N%*2);CHR$(64+N%):PRINTTAB(4+N%*3,4);CHR$(48+N%):PRINTTAB(31,4+N%*2);CHR$(64+N%):PRINTTAB(4+N%*3,22);CHR$(48+N%):NEXT 2880GOSUB2790 2890RETURN
2/�A%(9,9),I4%(8),J4%(8),D$(2),WT%(8,8),C$(8) 4 *TV0,1 7"�4:�23;8202;0;0;0;:�10,3);" " 9*FX16,0 <�:�10,3);"-OTHELLO-" F2%=0 ,-�:�4,7);"Do you want a difficult game "; 6 S2%=0 @�X$:�X$,1)="N"��DhA T�X$,1)<>"Y"��D@A ^ S2%=1 h4B%=-1:W%=1:D$(B%+1)="X":D$(0+1)=" ":D$(W%+1)="O" ��K%=1�8:�I4%(K%):� ��0,-1,-1,-1,0,1,1,1 ��K%=1�8:�J4%(K%):� ��1,1,0,-1,-1,-1,0,1 �#�I%=1�8:�J%=1�8:�WT%(I%,J%):�:� �� 38,0,24,25,25,24,0,38 �� 0,7,26,27,27,26,7,0 �� 24,26,28,28,28,28,26,24 �� 25,27,28,28,28,28,27,25 �� 25,27,28,28,28,28,27,25 �� 24,26,28,28,28,28,26,24 �� 0,7,26,27,27,26,7,0 �� 38,0,24,25,25,24,0,38 ��K%=1�8:�C$(K%):� $�"A","B","C","D","E","F","G","H" %�II%=0�9:�J%=0�9:A%(II%,J%)=0:�:� N/A%(4,4)=W%:A%(5,5)=W%:A%(4,5)=B%:A%(5,4)=B% v8C1%=2:H1%=2:N1%=4:Z%=0:�4,9);"Do you want X or O "; �C%=W%:H%=B% ��X$:�X$="X"��dnB ��X$<>"O"�X$<>"0"��t|B �C%=B%:H%=W% �'�4,11);"Do you want to go first "; ��X$:�X$,1)="N"��TtC �X$,1)<>"Y"��dxB �TlK:� INIT. BOARD �dfJ:� UPDAT. BOARD * �ThE 4'�TlK:�5,24);"Processing---":�DRC =� MACHINES MOVE >'�5,24);"Processing---":�F2%=0��DRC H�X$ R4B1%=-1:I3%=0:J3%=0:T1%=C%:T2%=H%:�I%=1�8:�J%=1�8 ��A%(I%,J%)<>0��TxD ��tRI:� CHECK IF LEGAL MOVE ��F1%=0��TxD �%U%=-1:�dlI:� CALC. VALUE OF MOVE ��S1%=0��TxD ��S2%<>0�S1%=S1%+WT%(I%,J%) ��S1%<B1%��TxD ��S1%>B1%��TZD �(2)=1��TxD B1%=S1%:� BEST MOVE SO FAR $I3%=I%:J3%=J% 8�:�:�B1%>0��D~D V&�5,26);"I MUST FORFEIT MY TURN "; `�Z%=1��tJG jZ%=1:�ThE ~"Z%=0:�5,26);"My turn was: "; ��C$(J3%);�(I3%+48); �I%=I3%:J%=J3%:U%=1 ��dlI:� CALC. VALUE OF MOVE �'C1%=C1%+S1%+1:H1%=H1%-S1%:N1%=N1%+1 �I�5,24);"I took ";S1%;" of your pieces.":�16,28);" ":�5,30);�(27) �dfJ �H1%=0��tJG � N1%=64��tJG '� PLAYERS MOVE (T1%=H%:T2%=C% <(�5,27);�(26):�5,28);"Your turn: "; P�Z$ Z�(Z$)=2��DdE��DxE d!Z1%=�(�Z$,1)):Z2%=�(�Z$,2,1)) n%�Z1%>47�Z1%<57�Z2%>64�Z2%<73��tBE s%�Z1%>64�Z1%<73�Z2%>47�Z2%<57��tBE x=�5,30);"Bad input--try again. ":�17,28);" ":�T|E ��Z1%>57��tVE �I%=Z1%-48:X$=�(Z2%):�t`E �I%=Z2%-48:X$=�(Z1%) ��I%<0��DPE ��I%>8��DPE ��I%<>0��TbF ��5,27);"Are you stuck "; ��X$ ��(X$)=0��dHE ��X$,1)<>"Y"��T|E �Z%=1��tJG Z%=1:�T~C "� '(J%=0:�JJ%=1�8:�C$(JJ%)=�X$,1)�J%=JJ% @� J�J%=0��DPE T�A%(I%,J%)=0��D|F ^(�5,30);"Invalid move--try again. " r �T|E | �tRI ��F1%=1��tnF �(�5,30);"Invalid move--try again. " � �T|E �U%=-1:�dlI ��S1%>0��dtF �(�5,30);"Invalid move--try again. " � �T|E �Z%=0 J�5,30);"You took ";S1%;" of my pieces. ":�5,24);�(26):�5,26);�(26) 0U%=1:�dlI D'H1%=H1%+S1%+1:C1%=C1%-S1%:N1%=N1%+1 b �dfJ l �C1%=0��tTG:� NO PIECES LEFT v�N1%=64��tTG:� BOARD FULL � �T~C �� �� *** END OF GAME �P�5,28);"You have ";H1%;" pieces.":�5,30);"I have ";C1%;" pieces. " ��H1%=C1%��TLH ��H1%>C1%��T`H ��5,26);"I WIN! " �dhH $�5,26);"DRAW!! ":�dhH �5,26);"YOU WIN! " �� �� CHECK FOR LEGAL MOVE �F1%=0:�I1%=-1�1:�J1%=-1�1 � �A%(I%+I1%,J%+J1%)=T2%�F1%=1 � �:�:� �S1%=0:�K%=1�8:I5%=I4%(K%) +J5%=J4%(K%):I6%=I%+I5%:J6%=J%+J5%:S3%=0 2�A%(I6%,J6%)<>T2%��dRJ <%S3%=S3%+1:I6%=I6%+I5%:J6%=J6%+J5% O� CALCULATE VALUE OF MOVE Z�A%(I6%,J6%)=T1%��DxJ d�A%(I6%,J6%)=0��dRJ n �T|J xS1%=S1%+S3%:�U%<>1��dRJ �FI6%=I%:J6%=J%:�K1%=0�S3%:A%(I6%,J6%)=T1%:I6%=I6%+I5%:J6%=J6%+J5%:� �� �� �� UPDATA BOARD �=�II%=1�8:�J%=1�8:�4+3*II%,4+2*J%);D$(A%(II%,J%)+1):�:�:� +� INITIALISATION ,L�:�N%=0�8:�189+N%*96,290:�189+N%*96,900:�125,N%*64+338:�1025,N%*64+338:� 6c�N%=1�8:�4,4+N%*2);�(64+N%):�4+N%*3,4);�(48+N%):�31,4+N%*2);�(64+N%):�4+N%*3,22);�(48+N%):� @ �dfJ J� �
00000000 0d 00 32 2f de 41 25 28 39 2c 39 29 2c 49 34 25 |..2/.A%(9,9),I4%| 00000010 28 38 29 2c 4a 34 25 28 38 29 2c 44 24 28 32 29 |(8),J4%(8),D$(2)| 00000020 2c 57 54 25 28 38 2c 38 29 2c 43 24 28 38 29 0d |,WT%(8,8),C$(8).| 00000030 00 34 0b 20 2a 54 56 30 2c 31 0d 00 37 22 eb 34 |.4. *TV0,1..7".4| 00000040 3a ef 32 33 3b 38 32 30 32 3b 30 3b 30 3b 30 3b |:.23;8202;0;0;0;| 00000050 3a f1 8a 31 30 2c 33 29 3b 22 20 22 0d 00 39 0b |:..10,3);" "..9.| 00000060 2a 46 58 31 36 2c 30 0d 00 3c 19 db 3a f1 8a 31 |*FX16,0..<..:..1| 00000070 30 2c 33 29 3b 22 2d 4f 54 48 45 4c 4c 4f 2d 22 |0,3);"-OTHELLO-"| 00000080 0d 01 18 09 46 32 25 3d 30 0d 01 2c 2d f7 3a f1 |....F2%=0..,-.:.| 00000090 8a 34 2c 37 29 3b 22 44 6f 20 79 6f 75 20 77 61 |.4,7);"Do you wa| 000000a0 6e 74 20 61 20 64 69 66 66 69 63 75 6c 74 20 67 |nt a difficult g| 000000b0 61 6d 65 20 22 3b 0d 01 36 09 53 32 25 3d 30 0d |ame ";..6.S2%=0.| 000000c0 01 40 18 e8 58 24 3a e7 c0 58 24 2c 31 29 3d 22 |.@..X$:..X$,1)="| 000000d0 4e 22 8c 8d 44 68 41 0d 01 54 15 e7 c0 58 24 2c |N"..DhA..T...X$,| 000000e0 31 29 3c 3e 22 59 22 8c 8d 44 40 41 0d 01 5e 09 |1)<>"Y"..D@A..^.| 000000f0 53 32 25 3d 31 0d 01 68 34 42 25 3d 2d 31 3a 57 |S2%=1..h4B%=-1:W| 00000100 25 3d 31 3a 44 24 28 42 25 2b 31 29 3d 22 58 22 |%=1:D$(B%+1)="X"| 00000110 3a 44 24 28 30 2b 31 29 3d 22 20 22 3a 44 24 28 |:D$(0+1)=" ":D$(| 00000120 57 25 2b 31 29 3d 22 4f 22 0d 01 9a 16 e3 4b 25 |W%+1)="O".....K%| 00000130 3d 31 b8 38 3a f3 49 34 25 28 4b 25 29 3a ed 0d |=1.8:.I4%(K%):..| 00000140 01 b8 17 dc 30 2c 2d 31 2c 2d 31 2c 2d 31 2c 30 |....0,-1,-1,-1,0| 00000150 2c 31 2c 31 2c 31 0d 01 c2 16 e3 4b 25 3d 31 b8 |,1,1,1.....K%=1.| 00000160 38 3a f3 4a 34 25 28 4b 25 29 3a ed 0d 01 e0 17 |8:.J4%(K%):.....| 00000170 dc 31 2c 31 2c 30 2c 2d 31 2c 2d 31 2c 2d 31 2c |.1,1,0,-1,-1,-1,| 00000180 30 2c 31 0d 01 e1 23 e3 49 25 3d 31 b8 38 3a e3 |0,1...#.I%=1.8:.| 00000190 4a 25 3d 31 b8 38 3a f3 57 54 25 28 49 25 2c 4a |J%=1.8:.WT%(I%,J| 000001a0 25 29 3a ed 3a ed 0d 01 e3 1b dc 20 33 38 2c 30 |%):.:...... 38,0| 000001b0 2c 32 34 2c 32 35 2c 32 35 2c 32 34 2c 30 2c 33 |,24,25,25,24,0,3| 000001c0 38 0d 01 e4 19 dc 20 30 2c 37 2c 32 36 2c 32 37 |8..... 0,7,26,27| 000001d0 2c 32 37 2c 32 36 2c 37 2c 30 0d 01 e5 1d dc 20 |,27,26,7,0..... | 000001e0 32 34 2c 32 36 2c 32 38 2c 32 38 2c 32 38 2c 32 |24,26,28,28,28,2| 000001f0 38 2c 32 36 2c 32 34 0d 01 e6 1d dc 20 32 35 2c |8,26,24..... 25,| 00000200 32 37 2c 32 38 2c 32 38 2c 32 38 2c 32 38 2c 32 |27,28,28,28,28,2| 00000210 37 2c 32 35 0d 01 e7 1d dc 20 32 35 2c 32 37 2c |7,25..... 25,27,| 00000220 32 38 2c 32 38 2c 32 38 2c 32 38 2c 32 37 2c 32 |28,28,28,28,27,2| 00000230 35 0d 01 e8 1d dc 20 32 34 2c 32 36 2c 32 38 2c |5..... 24,26,28,| 00000240 32 38 2c 32 38 2c 32 38 2c 32 36 2c 32 34 0d 01 |28,28,28,26,24..| 00000250 e9 19 dc 20 30 2c 37 2c 32 36 2c 32 37 2c 32 37 |... 0,7,26,27,27| 00000260 2c 32 36 2c 37 2c 30 0d 01 ea 1b dc 20 33 38 2c |,26,7,0..... 38,| 00000270 30 2c 32 34 2c 32 35 2c 32 35 2c 32 34 2c 30 2c |0,24,25,25,24,0,| 00000280 33 38 0d 01 ef 15 e3 4b 25 3d 31 b8 38 3a f3 43 |38.....K%=1.8:.C| 00000290 24 28 4b 25 29 3a ed 0d 02 08 24 dc 22 41 22 2c |$(K%):....$."A",| 000002a0 22 42 22 2c 22 43 22 2c 22 44 22 2c 22 45 22 2c |"B","C","D","E",| 000002b0 22 46 22 2c 22 47 22 2c 22 48 22 0d 02 1c 25 e3 |"F","G","H"...%.| 000002c0 49 49 25 3d 30 b8 39 3a e3 4a 25 3d 30 b8 39 3a |II%=0.9:.J%=0.9:| 000002d0 41 25 28 49 49 25 2c 4a 25 29 3d 30 3a ed 3a ed |A%(II%,J%)=0:.:.| 000002e0 0d 02 4e 2f 41 25 28 34 2c 34 29 3d 57 25 3a 41 |..N/A%(4,4)=W%:A| 000002f0 25 28 35 2c 35 29 3d 57 25 3a 41 25 28 34 2c 35 |%(5,5)=W%:A%(4,5| 00000300 29 3d 42 25 3a 41 25 28 35 2c 34 29 3d 42 25 0d |)=B%:A%(5,4)=B%.| 00000310 02 76 38 43 31 25 3d 32 3a 48 31 25 3d 32 3a 4e |.v8C1%=2:H1%=2:N| 00000320 31 25 3d 34 3a 5a 25 3d 30 3a f1 8a 34 2c 39 29 |1%=4:Z%=0:..4,9)| 00000330 3b 22 44 6f 20 79 6f 75 20 77 61 6e 74 20 58 20 |;"Do you want X | 00000340 6f 72 20 4f 20 22 3b 0d 02 a8 0f 43 25 3d 57 25 |or O ";....C%=W%| 00000350 3a 48 25 3d 42 25 0d 02 bc 14 e8 58 24 3a e7 58 |:H%=B%.....X$:.X| 00000360 24 3d 22 58 22 8c 8d 64 6e 42 0d 02 d0 19 e7 58 |$="X"..dnB.....X| 00000370 24 3c 3e 22 4f 22 80 58 24 3c 3e 22 30 22 8c 8d |$<>"O".X$<>"0"..| 00000380 74 7c 42 0d 02 da 0f 43 25 3d 42 25 3a 48 25 3d |t|B....C%=B%:H%=| 00000390 57 25 0d 02 ee 27 f1 8a 34 2c 31 31 29 3b 22 44 |W%...'..4,11);"D| 000003a0 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f 20 67 6f |o you want to go| 000003b0 20 66 69 72 73 74 20 22 3b 0d 02 f8 18 e8 58 24 | first ";.....X$| 000003c0 3a e7 c0 58 24 2c 31 29 3d 22 4e 22 8c 8d 54 74 |:..X$,1)="N"..Tt| 000003d0 43 0d 03 0c 15 e7 c0 58 24 2c 31 29 3c 3e 22 59 |C......X$,1)<>"Y| 000003e0 22 8c 8d 64 78 42 0d 03 16 17 e4 8d 54 6c 4b 3a |"..dxB......TlK:| 000003f0 f4 20 49 4e 49 54 2e 20 42 4f 41 52 44 0d 03 20 |. INIT. BOARD.. | 00000400 18 e4 8d 64 66 4a 3a f4 20 55 50 44 41 54 2e 20 |...dfJ:. UPDAT. | 00000410 42 4f 41 52 44 0d 03 2a 09 e5 8d 54 68 45 0d 03 |BOARD..*...ThE..| 00000420 34 27 e4 8d 54 6c 4b 3a f1 8a 35 2c 32 34 29 3b |4'..TlK:..5,24);| 00000430 22 50 72 6f 63 65 73 73 69 6e 67 2d 2d 2d 22 3a |"Processing---":| 00000440 e5 8d 44 52 43 0d 03 3d 13 f4 20 4d 41 43 48 49 |..DRC..=.. MACHI| 00000450 4e 45 53 20 4d 4f 56 45 0d 03 3e 27 f1 8a 35 2c |NES MOVE..>'..5,| 00000460 32 34 29 3b 22 50 72 6f 63 65 73 73 69 6e 67 2d |24);"Processing-| 00000470 2d 2d 22 3a e7 46 32 25 3d 30 8c 8d 44 52 43 0d |--":.F2%=0..DRC.| 00000480 03 48 07 e8 58 24 0d 03 52 34 42 31 25 3d 2d 31 |.H..X$..R4B1%=-1| 00000490 3a 49 33 25 3d 30 3a 4a 33 25 3d 30 3a 54 31 25 |:I3%=0:J3%=0:T1%| 000004a0 3d 43 25 3a 54 32 25 3d 48 25 3a e3 49 25 3d 31 |=C%:T2%=H%:.I%=1| 000004b0 b8 38 3a e3 4a 25 3d 31 b8 38 0d 03 8e 16 e7 41 |.8:.J%=1.8.....A| 000004c0 25 28 49 25 2c 4a 25 29 3c 3e 30 8c 8d 54 78 44 |%(I%,J%)<>0..TxD| 000004d0 0d 03 98 1f e4 8d 74 52 49 3a f4 20 43 48 45 43 |......tRI:. CHEC| 000004e0 4b 20 49 46 20 4c 45 47 41 4c 20 4d 4f 56 45 0d |K IF LEGAL MOVE.| 000004f0 03 a2 0f e7 46 31 25 3d 30 8c 8d 54 78 44 0d 03 |....F1%=0..TxD..| 00000500 ac 25 55 25 3d 2d 31 3a e4 8d 64 6c 49 3a f4 20 |.%U%=-1:..dlI:. | 00000510 43 41 4c 43 2e 20 56 41 4c 55 45 20 4f 46 20 4d |CALC. VALUE OF M| 00000520 4f 56 45 0d 03 c0 0f e7 53 31 25 3d 30 8c 8d 54 |OVE.....S1%=0..T| 00000530 78 44 0d 03 ca 1e e7 53 32 25 3c 3e 30 8c 53 31 |xD.....S2%<>0.S1| 00000540 25 3d 53 31 25 2b 57 54 25 28 49 25 2c 4a 25 29 |%=S1%+WT%(I%,J%)| 00000550 0d 03 f2 11 e7 53 31 25 3c 42 31 25 8c 8d 54 78 |.....S1%<B1%..Tx| 00000560 44 0d 03 fc 11 e7 53 31 25 3e 42 31 25 8c 8d 54 |D.....S1%>B1%..T| 00000570 5a 44 0d 04 06 10 e7 b3 28 32 29 3d 31 8c 8d 54 |ZD......(2)=1..T| 00000580 78 44 0d 04 1a 1e 42 31 25 3d 53 31 25 3a f4 20 |xD....B1%=S1%:. | 00000590 42 45 53 54 20 4d 4f 56 45 20 53 4f 20 46 41 52 |BEST MOVE SO FAR| 000005a0 0d 04 24 11 49 33 25 3d 49 25 3a 4a 33 25 3d 4a |..$.I3%=I%:J3%=J| 000005b0 25 0d 04 38 13 ed 3a ed 3a e7 42 31 25 3e 30 8c |%..8..:.:.B1%>0.| 000005c0 8d 44 7e 44 0d 04 56 26 f1 8a 35 2c 32 36 29 3b |.D~D..V&..5,26);| 000005d0 22 49 20 4d 55 53 54 20 46 4f 52 46 45 49 54 20 |"I MUST FORFEIT | 000005e0 4d 59 20 54 55 52 4e 20 22 3b 0d 04 60 0e e7 5a |MY TURN ";..`..Z| 000005f0 25 3d 31 8c 8d 74 4a 47 0d 04 6a 0e 5a 25 3d 31 |%=1..tJG..j.Z%=1| 00000600 3a e5 8d 54 68 45 0d 04 7e 22 5a 25 3d 30 3a f1 |:..ThE..~"Z%=0:.| 00000610 8a 35 2c 32 36 29 3b 22 4d 79 20 74 75 72 6e 20 |.5,26);"My turn | 00000620 77 61 73 3a 20 20 22 3b 0d 04 92 17 f1 43 24 28 |was: ";.....C$(| 00000630 4a 33 25 29 3b bd 28 49 33 25 2b 34 38 29 3b 0d |J3%);.(I3%+48);.| 00000640 04 a6 16 49 25 3d 49 33 25 3a 4a 25 3d 4a 33 25 |...I%=I3%:J%=J3%| 00000650 3a 55 25 3d 31 0d 04 c4 1f e4 8d 64 6c 49 3a f4 |:U%=1......dlI:.| 00000660 20 43 41 4c 43 2e 20 56 41 4c 55 45 20 4f 46 20 | CALC. VALUE OF | 00000670 4d 4f 56 45 0d 04 ce 27 43 31 25 3d 43 31 25 2b |MOVE...'C1%=C1%+| 00000680 53 31 25 2b 31 3a 48 31 25 3d 48 31 25 2d 53 31 |S1%+1:H1%=H1%-S1| 00000690 25 3a 4e 31 25 3d 4e 31 25 2b 31 0d 04 ec 49 f1 |%:N1%=N1%+1...I.| 000006a0 8a 35 2c 32 34 29 3b 22 49 20 74 6f 6f 6b 20 22 |.5,24);"I took "| 000006b0 3b 53 31 25 3b 22 20 6f 66 20 79 6f 75 72 20 70 |;S1%;" of your p| 000006c0 69 65 63 65 73 2e 22 3a f1 8a 31 36 2c 32 38 29 |ieces.":..16,28)| 000006d0 3b 22 20 20 20 22 3a f1 8a 35 2c 33 30 29 3b 89 |;" ":..5,30);.| 000006e0 28 32 37 29 0d 05 0a 09 e4 8d 64 66 4a 0d 05 14 |(27)......dfJ...| 000006f0 0f e7 48 31 25 3d 30 8c 8d 74 4a 47 0d 05 1e 11 |..H1%=0..tJG....| 00000700 e7 20 4e 31 25 3d 36 34 8c 8d 74 4a 47 0d 05 27 |. N1%=64..tJG..'| 00000710 12 f4 20 50 4c 41 59 45 52 53 20 4d 4f 56 45 0d |.. PLAYERS MOVE.| 00000720 05 28 11 54 31 25 3d 48 25 3a 54 32 25 3d 43 25 |.(.T1%=H%:T2%=C%| 00000730 0d 05 3c 28 f1 8a 35 2c 32 37 29 3b 89 28 32 36 |..<(..5,27);.(26| 00000740 29 3a f1 8a 35 2c 32 38 29 3b 22 59 6f 75 72 20 |):..5,28);"Your | 00000750 74 75 72 6e 3a 20 22 3b 0d 05 50 07 e8 5a 24 0d |turn: ";..P..Z$.| 00000760 05 5a 16 e7 a9 28 5a 24 29 3d 32 8c 8d 44 64 45 |.Z...(Z$)=2..DdE| 00000770 8b 8d 44 78 45 0d 05 64 21 5a 31 25 3d 97 28 c0 |..DxE..d!Z1%=.(.| 00000780 5a 24 2c 31 29 29 3a 5a 32 25 3d 97 28 c1 5a 24 |Z$,1)):Z2%=.(.Z$| 00000790 2c 32 2c 31 29 29 0d 05 6e 25 e7 5a 31 25 3e 34 |,2,1))..n%.Z1%>4| 000007a0 37 80 5a 31 25 3c 35 37 80 5a 32 25 3e 36 34 80 |7.Z1%<57.Z2%>64.| 000007b0 5a 32 25 3c 37 33 8c 8d 74 42 45 0d 05 73 25 e7 |Z2%<73..tBE..s%.| 000007c0 5a 31 25 3e 36 34 80 5a 31 25 3c 37 33 80 5a 32 |Z1%>64.Z1%<73.Z2| 000007d0 25 3e 34 37 80 5a 32 25 3c 35 37 8c 8d 74 42 45 |%>47.Z2%<57..tBE| 000007e0 0d 05 78 3d f1 8a 35 2c 33 30 29 3b 22 42 61 64 |..x=..5,30);"Bad| 000007f0 20 69 6e 70 75 74 2d 2d 74 72 79 20 61 67 61 69 | input--try agai| 00000800 6e 2e 20 20 20 20 20 22 3a f1 8a 31 37 2c 32 38 |n. ":..17,28| 00000810 29 3b 22 20 20 20 22 3a e5 8d 54 7c 45 0d 05 82 |);" ":..T|E...| 00000820 10 e7 5a 31 25 3e 35 37 8c 8d 74 56 45 0d 05 8c |..Z1%>57..tVE...| 00000830 1d 49 25 3d 5a 31 25 2d 34 38 3a 58 24 3d bd 28 |.I%=Z1%-48:X$=.(| 00000840 5a 32 25 29 3a e5 8d 74 60 45 0d 05 96 17 49 25 |Z2%):..t`E....I%| 00000850 3d 5a 32 25 2d 34 38 3a 58 24 3d bd 28 5a 31 25 |=Z2%-48:X$=.(Z1%| 00000860 29 0d 05 a0 0e e7 49 25 3c 30 8c 8d 44 50 45 0d |).....I%<0..DPE.| 00000870 05 aa 0e e7 49 25 3e 38 8c 8d 44 50 45 0d 05 b4 |....I%>8..DPE...| 00000880 0f e7 49 25 3c 3e 30 8c 8d 54 62 46 0d 05 c8 1d |..I%<>0..TbF....| 00000890 f1 8a 35 2c 32 37 29 3b 22 41 72 65 20 79 6f 75 |..5,27);"Are you| 000008a0 20 73 74 75 63 6b 20 22 3b 0d 05 dc 07 e8 58 24 | stuck ";.....X$| 000008b0 0d 05 f0 11 e7 a9 28 58 24 29 3d 30 8c 8d 64 48 |......(X$)=0..dH| 000008c0 45 0d 05 fa 15 e7 c0 58 24 2c 31 29 3c 3e 22 59 |E......X$,1)<>"Y| 000008d0 22 8c 8d 54 7c 45 0d 06 04 0e e7 5a 25 3d 31 8c |"..T|E.....Z%=1.| 000008e0 8d 74 4a 47 0d 06 0e 0e 5a 25 3d 31 3a e5 8d 54 |.tJG....Z%=1:..T| 000008f0 7e 43 0d 06 22 05 f4 0d 06 27 28 4a 25 3d 30 3a |~C.."....'(J%=0:| 00000900 e3 4a 4a 25 3d 31 b8 38 3a e7 43 24 28 4a 4a 25 |.JJ%=1.8:.C$(JJ%| 00000910 29 3d c0 58 24 2c 31 29 8c 4a 25 3d 4a 4a 25 0d |)=.X$,1).J%=JJ%.| 00000920 06 40 05 ed 0d 06 4a 0e e7 4a 25 3d 30 8c 8d 44 |.@....J..J%=0..D| 00000930 50 45 0d 06 54 15 e7 41 25 28 49 25 2c 4a 25 29 |PE..T..A%(I%,J%)| 00000940 3d 30 8c 8d 44 7c 46 0d 06 5e 28 f1 8a 35 2c 33 |=0..D|F..^(..5,3| 00000950 30 29 3b 22 49 6e 76 61 6c 69 64 20 6d 6f 76 65 |0);"Invalid move| 00000960 2d 2d 74 72 79 20 61 67 61 69 6e 2e 20 20 22 0d |--try again. ".| 00000970 06 72 09 e5 8d 54 7c 45 0d 06 7c 09 e4 8d 74 52 |.r...T|E..|...tR| 00000980 49 0d 06 86 0f e7 46 31 25 3d 31 8c 8d 74 6e 46 |I.....F1%=1..tnF| 00000990 0d 06 90 28 f1 8a 35 2c 33 30 29 3b 22 49 6e 76 |...(..5,30);"Inv| 000009a0 61 6c 69 64 20 6d 6f 76 65 2d 2d 74 72 79 20 61 |alid move--try a| 000009b0 67 61 69 6e 2e 20 20 22 0d 06 a4 09 e5 8d 54 7c |gain. "......T|| 000009c0 45 0d 06 ae 0f 55 25 3d 2d 31 3a e4 8d 64 6c 49 |E....U%=-1:..dlI| 000009d0 0d 06 c2 0f e7 53 31 25 3e 30 8c 8d 64 74 46 0d |.....S1%>0..dtF.| 000009e0 06 cc 28 f1 8a 35 2c 33 30 29 3b 22 49 6e 76 61 |..(..5,30);"Inva| 000009f0 6c 69 64 20 6d 6f 76 65 2d 2d 74 72 79 20 61 67 |lid move--try ag| 00000a00 61 69 6e 2e 20 20 22 0d 06 e0 09 e5 8d 54 7c 45 |ain. "......T|E| 00000a10 0d 06 f4 08 5a 25 3d 30 0d 07 12 4a f1 8a 35 2c |....Z%=0...J..5,| 00000a20 33 30 29 3b 22 59 6f 75 20 74 6f 6f 6b 20 22 3b |30);"You took ";| 00000a30 53 31 25 3b 22 20 6f 66 20 6d 79 20 70 69 65 63 |S1%;" of my piec| 00000a40 65 73 2e 20 20 22 3a f1 8a 35 2c 32 34 29 3b 89 |es. ":..5,24);.| 00000a50 28 32 36 29 3a f1 8a 35 2c 32 36 29 3b 89 28 32 |(26):..5,26);.(2| 00000a60 36 29 0d 07 30 0e 55 25 3d 31 3a e4 8d 64 6c 49 |6)..0.U%=1:..dlI| 00000a70 0d 07 44 27 48 31 25 3d 48 31 25 2b 53 31 25 2b |..D'H1%=H1%+S1%+| 00000a80 31 3a 43 31 25 3d 43 31 25 2d 53 31 25 3a 4e 31 |1:C1%=C1%-S1%:N1| 00000a90 25 3d 4e 31 25 2b 31 0d 07 62 09 e4 8d 64 66 4a |%=N1%+1..b...dfJ| 00000aa0 0d 07 6c 20 e7 43 31 25 3d 30 8c 8d 74 54 47 3a |..l .C1%=0..tTG:| 00000ab0 f4 20 4e 4f 20 50 49 45 43 45 53 20 4c 45 46 54 |. NO PIECES LEFT| 00000ac0 0d 07 76 1d e7 4e 31 25 3d 36 34 8c 8d 74 54 47 |..v..N1%=64..tTG| 00000ad0 3a f4 20 42 4f 41 52 44 20 46 55 4c 4c 0d 07 80 |:. BOARD FULL...| 00000ae0 09 e5 8d 54 7e 43 0d 07 8a 05 f4 0d 07 93 15 f4 |...T~C..........| 00000af0 20 2a 2a 2a 20 45 4e 44 20 4f 46 20 47 41 4d 45 | *** END OF GAME| 00000b00 0d 07 94 50 f1 8a 35 2c 32 38 29 3b 22 59 6f 75 |...P..5,28);"You| 00000b10 20 68 61 76 65 20 22 3b 48 31 25 3b 22 20 70 69 | have ";H1%;" pi| 00000b20 65 63 65 73 2e 22 3a f1 8a 35 2c 33 30 29 3b 22 |eces.":..5,30);"| 00000b30 49 20 68 61 76 65 20 22 3b 43 31 25 3b 22 20 70 |I have ";C1%;" p| 00000b40 69 65 63 65 73 2e 20 20 20 20 20 20 20 20 20 22 |ieces. "| 00000b50 0d 07 e4 11 e7 48 31 25 3d 43 31 25 8c 8d 54 4c |.....H1%=C1%..TL| 00000b60 48 0d 07 ee 11 e7 48 31 25 3e 43 31 25 8c 8d 54 |H.....H1%>C1%..T| 00000b70 60 48 0d 07 f8 1e f1 8a 35 2c 32 36 29 3b 22 49 |`H......5,26);"I| 00000b80 20 57 49 4e 21 20 20 20 20 20 20 20 20 20 20 22 | WIN! "| 00000b90 0d 08 02 09 e5 8d 64 68 48 0d 08 0c 24 f1 8a 35 |......dhH...$..5| 00000ba0 2c 32 36 29 3b 22 44 52 41 57 21 21 20 20 20 20 |,26);"DRAW!! | 00000bb0 20 20 20 20 20 20 22 3a e5 8d 64 68 48 0d 08 20 | ":..dhH.. | 00000bc0 20 f1 8a 35 2c 32 36 29 3b 22 59 4f 55 20 57 49 | ..5,26);"YOU WI| 00000bd0 4e 21 20 20 20 20 20 20 20 20 20 20 22 0d 08 e8 |N! "...| 00000be0 05 e0 0d 09 91 1a f4 20 43 48 45 43 4b 20 46 4f |....... CHECK FO| 00000bf0 52 20 4c 45 47 41 4c 20 4d 4f 56 45 0d 09 92 1d |R LEGAL MOVE....| 00000c00 46 31 25 3d 30 3a e3 49 31 25 3d 2d 31 b8 31 3a |F1%=0:.I1%=-1.1:| 00000c10 e3 4a 31 25 3d 2d 31 b8 31 0d 09 b0 20 e7 41 25 |.J1%=-1.1... .A%| 00000c20 28 49 25 2b 49 31 25 2c 4a 25 2b 4a 31 25 29 3d |(I%+I1%,J%+J1%)=| 00000c30 54 32 25 8c 46 31 25 3d 31 0d 09 ba 09 ed 3a ed |T2%.F1%=1.....:.| 00000c40 3a f8 0d 09 ec 1d 53 31 25 3d 30 3a e3 4b 25 3d |:.....S1%=0:.K%=| 00000c50 31 b8 38 3a 49 35 25 3d 49 34 25 28 4b 25 29 0d |1.8:I5%=I4%(K%).| 00000c60 0a 0a 2b 4a 35 25 3d 4a 34 25 28 4b 25 29 3a 49 |..+J5%=J4%(K%):I| 00000c70 36 25 3d 49 25 2b 49 35 25 3a 4a 36 25 3d 4a 25 |6%=I%+I5%:J6%=J%| 00000c80 2b 4a 35 25 3a 53 33 25 3d 30 0d 0a 32 1a e7 41 |+J5%:S3%=0..2..A| 00000c90 25 28 49 36 25 2c 4a 36 25 29 3c 3e 54 32 25 8c |%(I6%,J6%)<>T2%.| 00000ca0 8d 64 52 4a 0d 0a 3c 25 53 33 25 3d 53 33 25 2b |.dRJ..<%S3%=S3%+| 00000cb0 31 3a 49 36 25 3d 49 36 25 2b 49 35 25 3a 4a 36 |1:I6%=I6%+I5%:J6| 00000cc0 25 3d 4a 36 25 2b 4a 35 25 0d 0a 4f 1f f4 20 43 |%=J6%+J5%..O.. C| 00000cd0 41 4c 43 55 4c 41 54 45 20 56 41 4c 55 45 20 4f |ALCULATE VALUE O| 00000ce0 46 20 4d 4f 56 45 20 20 0d 0a 5a 19 e7 41 25 28 |F MOVE ..Z..A%(| 00000cf0 49 36 25 2c 4a 36 25 29 3d 54 31 25 8c 8d 44 78 |I6%,J6%)=T1%..Dx| 00000d00 4a 0d 0a 64 17 e7 41 25 28 49 36 25 2c 4a 36 25 |J..d..A%(I6%,J6%| 00000d10 29 3d 30 8c 8d 64 52 4a 0d 0a 6e 09 e5 8d 54 7c |)=0..dRJ..n...T|| 00000d20 4a 0d 0a 78 1b 53 31 25 3d 53 31 25 2b 53 33 25 |J..x.S1%=S1%+S3%| 00000d30 3a e7 55 25 3c 3e 31 8c 8d 64 52 4a 0d 0a 8c 46 |:.U%<>1..dRJ...F| 00000d40 49 36 25 3d 49 25 3a 4a 36 25 3d 4a 25 3a e3 4b |I6%=I%:J6%=J%:.K| 00000d50 31 25 3d 30 b8 53 33 25 3a 41 25 28 49 36 25 2c |1%=0.S3%:A%(I6%,| 00000d60 4a 36 25 29 3d 54 31 25 3a 49 36 25 3d 49 36 25 |J6%)=T1%:I6%=I6%| 00000d70 2b 49 35 25 3a 4a 36 25 3d 4a 36 25 2b 4a 35 25 |+I5%:J6%=J6%+J5%| 00000d80 3a ed 0d 0a d2 05 ed 0d 0a dc 05 f8 0d 0a e5 12 |:...............| 00000d90 f4 20 55 50 44 41 54 41 20 42 4f 41 52 44 0d 0a |. UPDATA BOARD..| 00000da0 e6 3d e3 49 49 25 3d 31 b8 38 3a e3 4a 25 3d 31 |.=.II%=1.8:.J%=1| 00000db0 b8 38 3a f1 8a 34 2b 33 2a 49 49 25 2c 34 2b 32 |.8:..4+3*II%,4+2| 00000dc0 2a 4a 25 29 3b 44 24 28 41 25 28 49 49 25 2c 4a |*J%);D$(A%(II%,J| 00000dd0 25 29 2b 31 29 3a ed 3a ed 3a f8 0d 0b 2b 14 f4 |%)+1):.:.:...+..| 00000de0 20 49 4e 49 54 49 41 4c 49 53 41 54 49 4f 4e 0d | INITIALISATION.| 00000df0 0b 2c 4c db 3a e3 4e 25 3d 30 b8 38 3a ec 31 38 |.,L.:.N%=0.8:.18| 00000e00 39 2b 4e 25 2a 39 36 2c 32 39 30 3a df 31 38 39 |9+N%*96,290:.189| 00000e10 2b 4e 25 2a 39 36 2c 39 30 30 3a ec 31 32 35 2c |+N%*96,900:.125,| 00000e20 4e 25 2a 36 34 2b 33 33 38 3a df 31 30 32 35 2c |N%*64+338:.1025,| 00000e30 4e 25 2a 36 34 2b 33 33 38 3a ed 0d 0b 36 63 e3 |N%*64+338:...6c.| 00000e40 4e 25 3d 31 b8 38 3a f1 8a 34 2c 34 2b 4e 25 2a |N%=1.8:..4,4+N%*| 00000e50 32 29 3b bd 28 36 34 2b 4e 25 29 3a f1 8a 34 2b |2);.(64+N%):..4+| 00000e60 4e 25 2a 33 2c 34 29 3b bd 28 34 38 2b 4e 25 29 |N%*3,4);.(48+N%)| 00000e70 3a f1 8a 33 31 2c 34 2b 4e 25 2a 32 29 3b bd 28 |:..31,4+N%*2);.(| 00000e80 36 34 2b 4e 25 29 3a f1 8a 34 2b 4e 25 2a 33 2c |64+N%):..4+N%*3,| 00000e90 32 32 29 3b bd 28 34 38 2b 4e 25 29 3a ed 0d 0b |22);.(48+N%):...| 00000ea0 40 09 e4 8d 64 66 4a 0d 0b 4a 05 f8 0d ff |@...dfJ..J....| 00000eae