Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-06 - 43,50367/hexpaw.src
There are no other files named hexpaw.src in the archive.
0 '            ******  HEXPAWN - 26-NOV-75  ******
20 '        ******  PROGRAMMED BY R. KLESTADT  ******
30 PRINT
40 PRINT
50 PRINT
60 PRINT"*HEXPAWN"
70 PRINT
80 DIM A$(42),A1(42,3),G$(14)
90 FOR I=1 TO 42
100 READ A$(I),A1(I,1),A1(I,2),A1(I,3)
110 NEXT I
120 RANDOMIZE
130 GO TO 160 
140 A1(2,1)=A1(2,2)=0
150 A1(13,1)=A1(14,1)=A1(19,1)=0
160 FOR I=1 TO 9
170 READ A2(I)
180 NEXT I
190 FOR I=1 TO 14
200 READ G$(I)
210 NEXT I
220 PRINT"DO YOU REQUIRE HELP";
230 INPUT Z$
240 IF Z$="NO" THEN 380 
250 PRINT"THE GAME OF HEXPAWN IS PLAYED ON A 3 BY 3 CHESS BOARD, WITH"
260 PRINT"EACH PLAYER HAVING THREE PAWNS.  THE OBJECT OF THE GAME IS"
270 PRINT"TO GET ONE OF YOUR PAWNS TO THE OPPOSITE SIDE FIRST OR TO"
280 PRINT"CAPTURE ALL OF THE PAWNS OF THE OPPOSITION.  YOU MAY ALSO WIN"
290 PRINT"BY BLOCKING THE OPPOSITION SO IT CANNOT MOVE, LIKEWISE YOU"
300 PRINT"MAY BE BLOCKED AND YOU WILL LOSE.  THE STANDARD RULES OF PAWNS AS"
310 PRINT"IN CHESS APPLY (EXCEPT YOU MAY NOT MOVE TWO SPACES FORWARD) WITH"
320 PRINT"THE ONLY MOVEMENT BEING FORWARD TO ADVANCE AND DIAGONALLY TO"
330 PRINT"CAPTURE.  YOU MAY WIN EASILY AT FIRST, BUT I AM GOING TO LEARN FROM"
340 PRINT"MY MISTAKES.  MOVES ARE MADE USING A SYSTEM OF ROWS AND"
350 PRINT"COLUMNS, STATING A NUMBER PAIR SUCH AS: 32,22.  THIS WOULD MEAN MOVE"
360 PRINT"THE PAWN IN ROW THREE, COLUMN TWO TO ROW TWO, COLUMN TWO."
370 PRINT
380 PRINT"THE BOARD IS GIVEN BELOW.  YOU ARE ""O"", I AM ""X""":PRINT
390 PRINT"   1  2  3"
400 PRINT" 1 X  X  X"
410 PRINT" 2"
420 PRINT" 3 O  O  O"
430 C$="XXX   OOO"
440 A1(3,1)=15+20*INT(.5+RND)
450 PRINT"WHAT IS YOUR MOVE";
460 INPUT B1,B2
470 IF B1*B2=0 THEN GOTO 1150 
480 FOR I=1 TO 9
490 IF B1=A2(I) THEN 550 
500 IF B2=A2(I) THEN 580 
510 NEXT I: IF N1=2 THEN 610 
520 N1=0
530 PRINT"INVALID REPLY.  WHAT IS YOUR MOVE";
540 GO TO 460 
550 N1=N1+1
560 B3=I
570 GO TO 510 
580 N1=N1+1
590 B4=I
600 GO TO 510 
610 N1=0
620 ON B1-B2-8 GO TO 660 ,640 ,660 
630 GO TO 750 
640 IF SBS$(C$,B4,B4)=" " THEN 680 
650 GO TO 750 
660 IF SBS$(C$,B4,B4)="X" THEN 680 
670 GO TO 750 
680 IF SBS$(C$,B3,B3)<>"O" THEN 750 
690 D$=SBS$(C$,1,B3-1)+" "+SBS$(C$,B3+1,9)
700 D$=SBS$(D$,1,B4-1)+"O"+SBS$(D$,B4+1,9)
710 IF B4<4 THEN 1130 'HUMAN WINS
720 FOR I=1 TO 42
730 IF D$=A$(I) THEN 770 
740 NEXT I
750 PRINT"THIS IS AN INVALID MOVE.  TRY AGAIN.  YOUR MOVE";
760 GO TO 460 
770 C$=D$
780 FOR J=1 TO 3
790 IF A1(I,J)=999 THEN 830 
800 IF A1(I,J)<>0 THEN 840 
810 NEXT J
820 GO TO 1520 
830 PRINT"I AM BLOCKED.": GO TO 1130 
840 B5=INT(A1(I,J)/10)
850 B6=A1(I,J)-10*B5
860 I1=I:J1=J
870 PRINT"MY MOVE IS ";A2(B5);",";A2(B6)
880 D$=SBS$(C$,1,B5-1)+" "+SBS$(C$,B5+1,9)
890 D$=SBS$(D$,1,B6-1)+"X"+SBS$(D$,B6+1,9)
900 PRINT"THE BOARD NOW LOOKS AS FOLLOWS"
910 PRINT"   1  2  3"
920 N4=0:N5=0
930 FOR I=1 TO 3
940 PRINT TAB(0);I;
950 FOR J=1 TO 3
960 N2=(I-1)*3+J
970 E$=SBS$(D$,N2,N2)
980 IF E$="O" THEN N4=1
990 IF E$="X" THEN N5=1
1000 PRINT TAB(3*J);E$;
1010 NEXT J
1020 PRINT
1030 NEXT I
1040 IF N4=0 THEN 1210 
1050 IF N5=0 THEN 1130 
1060 FOR I=1 TO 14
1070 IF D$=G$(I) THEN 1200 
1080 NEXT I
1090 IF B6>6 THEN 1210 'COMPUTER WINS
1100 PRINT"YOUR NEXT MOVE";
1110 C$=D$
1120 GO TO 460 
1130 A1(I1,J1)=0
1140 PRINT"YOU WIN!"
1150 PRINT"SHALL WE PLAY ANOTHER GAME";
1160 INPUT F$
1170 IF F$="YES" THEN 1180 ELSE 1520 
1180 PRINT:PRINT"HERE IS THE BOARD."
1190 GO TO 390 
1200 PRINT"YOU ARE BLOCKED."
1210 PRINT"I WIN!"
1220 GO TO 1150 
1230 DATA"XXXO   OO",24,25,36,"XXX  OOO ",14,25,26
1240 DATA"XXX O O O",15,0,0,"X XXO   O",15,35,47
1250 DATA" XXOX   O",24,36,58,"X XOO  O ",15,35,36
1260 DATA"XX O O  O",24,25,26," XX XOO  ",26,57,58
1270 DATA" XXXOOO  ",26,35,0,"X XX O O ",47,48,0
1280 DATA"XX OOX  O",15,24,0," XXO OO  ",24,25,26
1290 DATA" XX O   O",35,36,0," XX O O  ",35,36,0
1300 DATA"X XO    O",36,0,0,"  XXXO   ",47,58,0
1310 DATA"X  OOO   ",15,0,0," X XOO   ",47,26,0
1320 DATA" X OOX   ",24,69,0,"X  XXO   ",47,48,0
1330 DATA"X XO O  O",999,0,0,"X  OX  O ",999,0,0
1340 DATA"  XOXX   ",58,69,0,"  XXO    ",35,36,47
1350 DATA" X OX    ",24,58,0," X XO    ",26,58,0
1360 DATA"X XO     ",15,47,0,"  X OX   ",35,69,0
1370 DATA"X  OO    ",15,0,0,"X X OO O ",14,15,35
1380 DATA" X  O    ",999,0,0,"X XOXO O ",999,0,0
1390 DATA"  XOOO   ",35,0,0,"X X OXO  ",35,15,69
1400 DATA"XX  XOO  ",26,14,58,"XX OX   O",24,59,58
1410 DATA"X XO X O ",69,68,0,"XX  O O  ",15,14,0
1420 DATA"XX  O   O",15,14,0,"X X  OO  ",14,0,0
1430 DATA"X  OXX   ",69,58,0,"X   OX   ",15,14,69
1440 DATA 11,12,13,21,22,23,31,32,33
1450 DATA"X  OX  OX","X  O X  O"
1460 DATA" XX OX  O","X XO X  O"
1470 DATA"  X XOXO ","  XX OO  "
1480 DATA"XX XO O  ","X XX OO  "
1490 DATA"  X XO O ","X  OX  O "
1500 DATA"  XX OO  ","X  O X  O"
1510 DATA" X  OX  O"," X XO O  "
1520 END

*U*,