Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-04 - decus/20-0129/bakgmn.bas
There are 2 other files named bakgmn.bas in the archive. Click here to see a list.
00010  RANDOMIZE
00020  FOR I=1 TO 1000
00030     LET X=RND
00040  NEXT I
00050  DEF FNM(A,B)=(A+B+ABS(A-B))/2
00060  DEF FNF(M)
00070  LET G2=0
00080  FOR L=1 TO 6
00090     IF M+L>24 GO TO 130
00100     IF V(M+L)>1 GO TO 120
00110     LET G2=G2+F8
00120  NEXT L
00130  LET FNF=G2
00140  FNEND
00150  DIM A(25)
00160  DIM V(25)
00170  DIM T(25)
00180  DIM U(25),S(25)
00190  DIM F(24)
00200  DIM A$(24)
00210  DIM B(2)
00220  DIM C(2)
00230  DIM D(4)
00240  DIM E(4)
00250  DIM N(40)
00260  DIM Q$(2),X$(2),Y$(3),Z$(2)
00270  LET B9=W9=0								'SET POINTS SCORED EQUAL TO 0
00280  LET F8=.55
00290  LET X=1
00300  LET Y=2
00310  LET Y$(3)="W"
00320  LET Y$(1)="B"
00330  LET X$(1)=" WHITE"
00340  LET X$(2)=" BLACK"
00350  LET Q$(1)="YOU"
00360  LET Q$(2)="I"
00370  LET Z$(1)="X"
00380  LET Z$(2)="O"
00390  LET Z=1
00400  MAT READ A
00410  MAT T=A
00420  PRINT L9$;"WHAT ARE YOU? 1)TTY  2)VT50  3)VT52  4)OTHER"
00430  PRINT L9$;"TYPE 1,2,3 OR 4"
00440  INPUT M1$
00450  CHANGE M1$ TO H6
00460  LET H6(1)=H6(1)-48
00470  GOSUB 12870
00480  LET H9$=CHR$(N(1))+CHR$(N(2))
00490  LET S9$=CHR$(N(1))+CHR$(N(3))
00500  LET L9$=CHR$(N(1))+CHR$(N(4))
00510  LET C9$=CHR$(N(1))+CHR$(N(5))
00520  PRINT L9$;"TYPE ";CHR$(34);"INS";CHR$(34);" FOR INSTRUCTIONS & OPTIONS"
00530  PRINT L9$;CHR$(34);"OPT";CHR$(34);
00540  PRINT L9$;" FOR OPTIONS, OR PRESS RETURN TO START PLAY."
00550  INPUT M1$
00560  LET S9=D9=1								'SET AUTO DOUBLE FLAG & CUBE
00570  IF M1$="" GOTO 860
00580  CHANGE M1$ TO N
00590  LET T=N(1)
00600  IF ABS(89-T)<>16 GO TO 710
00610  PRINT L9$;"WE ARE GOING TO PLAY A GAME OF BACKGAMMON."
00620  PRINT
00630  GOSUB 10750
00640  GOSUB 11340
00650  PRINT "THE BOARD LOOKS LIKE THIS:-"
00660  IF H6(1)=2 GOTO 690
00670  GOSUB 3760
00680  GO TO 520
00690  GOSUB 3500
00700  GOTO 520
00710  IF ABS(95-T)<>16 GO TO 520
00720  GOSUB 11340
00730  GO TO 520
00740  IF S9<>1 GOTO 910
00750  PRINT L9$;H9$;"THEY ARE EQUAL, WE MUST THROW AGAIN."
00760  IF S9<>1 GOTO 840
00770  LET S9=D9=D9*2								'IS IT FIRST DOUBLE ..YES
00780  PRINT L9$;"......AUTOMATIC DOUBLE THE CUBE WILL BECOME ......";D9
00790  PRINT L9$;"THAT IS IF YOU WISH TO PLAY THAT RULE, DO YOU?"
00800  PRINT L9$;"TYPE Y OR N";
00810  INPUT M1$
00820  IF M1$<>"Y" GO TO 840
00830  LET D9=1
00840  LET R9=D8=0
00850  GOTO 920
00860  IF H6(1)=2 GOTO 900
00870  GOSUB 3760
00880  GOSUB 4600
00890  GO TO 920
00900  GOSUB 3500
00910  PRINT H9$;L9$
00920  LET D1=INT(RND*6)+1
00930  LET D2=RND+RND+RND+RND+RND+RND+RND+RND+RND+RND
00940  LET D2=INT(6*RND)+1
00950  PRINT L9$;"YOU THREW A ";D1
00960  PRINT L9$;"  I THREW A ";D2;
00970  IF D1=D2 GOTO 740
00980  IF D1>D2 GO TO 1000
00990  LET Z=2
01000  PRINT L9$;Q$(Z);" MOVE FIRST";
01010  GO TO 1300
01020  PRINT L9$
01030  LET F8=F8-.01
01040  IF C(1)=0 GO TO 1060
01050  PRINT L9$;"WHITE;";C(1);"BORNE OFF"
01060  IF C(2)=0 GO TO 1080
01070  PRINT L9$;"BLACK;";C(2);"BORNE OFF."
01080  IF B(3-Z)=0 GO TO 1100
01090  PRINT L9$;X$(3-Z);" HAS";B(3-Z);" ON THE BAR.";
01100  IF B(Z)=0 GO TO 1250
01110  PRINT L9$;X$(Z);" HAS";B(Z);" ON THE BAR.";
01120  IF Z=2 GO TO 1170
01130  FOR J=19 TO 24
01140     IF A(J)>-2 GO TO 1250
01150  NEXT J
01160  GO TO 1200
01170  FOR J=1 TO 6
01180     IF A(J)<2 GO TO 1250
01190  NEXT J
01200  PRINT L9$;X$(Z);" CANNOT COME IN.";
01210  IF H6(1)=1 GOTO 1240
01220  PRINT L9$;"TO CONTINUE HIT <C.R.> ..";
01230  INPUT M1$
01240  LET Z=3-Z
01250  LET D1=RND+RND+RND
01260  LET D1=INT(6*RND)+1
01270  LET D2=RND+RND+RND+RND+RND+RND
01280  LET D2=INT(6*RND)+1
01290  PRINT H9$
01300  PRINT L9$;X$(Z);"'S TURN.";
01310  IF Z=1 GOTO 1350
01320  IF D8=1 GOTO 1370
01330  GOSUB 12220'NO - EVALUATE POSITION
01340  GOTO 1370
01350 IF R9<>1 GOTO 1370
01360  GOSUB 12110'YES
01370  PRINT L9$;D1;",";D2
01380  PRINT L9$
01390  PRINT L9$
01400  IF B(Z)=0 GO TO 1470
01410  IF Z=2 GO TO 1450
01420  IF A(25-D1)>-2 GO TO 1470
01430  IF A(25-D2)>-2 GO TO 1470
01440  GO TO 1200
01450  IF A(D1)<2 GO TO 1470
01460  IF A(D2)>1 GO TO 1200
01470  LET D(1)=D1
01480  LET D(2)=D2
01490  LET D1=(D1+D2+ABS(D1-D2))/2
01500  LET D2=D(2)=D(1)+D2-D1
01510  LET D(1)=D1
01520  LET N=2
01530  IF D1<>D2 GO TO 1560
01540  LET D(3)=D(4)=D2
01550  LET N=4
01560  LET S=N
01570  IF Z=2 GO TO 5370
01580  LET A(25)=B(1)
01590  PRINT H9$;L9$;
01600  MAT INPUT N$
01610  LET N9=NUM
01620  LET I9=0
01630  IF N9=I9 GO TO 2870
01640  LET I9=I9+1
01650  LET N5=1
01660  LET M$(1)=""
01670  CHANGE N$(I9) TO N
01680  FOR J=1 TO N(0)
01690     LET N2=N(J)
01700     IF N2=45 GO TO 1770
01710     IF N2=32 GO TO 1790
01720     IF N2<97 GO TO 1750
01730     IF N2>122 GO TO 1750
01740     LET N2=N2-32
01750     LET M$(N5)=M$(N5)+CHR$(N2)
01760     GO TO 1790
01770     LET N5=N5+1
01780     LET M$(N5)=""
01790  NEXT J
01800  IF N5=1 GO TO 3150
01810  CHANGE M$(2) TO N
01820 IF M$(2)="" GOTO 3130
01830  FOR J=1 TO N(0)
01840     IF N(J)<48 GO TO 3130
01850     IF N(J)>57 GO TO 3130
01860  NEXT J
01870  LET T=VAL(M$(2))
01880  IF T>24 GO tO 3130
01890  LET L1=1
01900  IF N5=2 GO TO 1970
01910  CHANGE M$(3) TO N
01920  FOR J=1 TO N(0)
01930     IF N(J)<48 GO TO 3130
01940     IF N(J)>57 GO TO 3130
01950  NEXT J
01960  LET L1=VAL(M$(3))
01970  FOR K=1 TO L1
01980     LET N1=1
01990     IF M$(1)="B" GO TO 2930
02000     CHANGE M$(1) TO N
02010     FOR J=1 TO N(0)
02020        IF N(J)<48 GO TO 3130
02030        IF N(J)>57 GO TO 3130
02040     NEXT J
02050     LET F=VAL(M$(1))
02060     IF F=25 GO TO 2120
02070     IF F<1 GO TO 3130
02080     IF F>24 GO TO 3130
02090     IF A(25)=0 GO TO 2120
02100     PRINT L9$;A(25);"MEN ON THE BAR."
02110     GO TO 3130
02120     IF A(F)>0 GO TO 2150
02130     PRINT L9$;"YOU DO NOT HAVE A PIECE ON";F
02140     GO TO 3130
02150     IF A(T)>-2 GO TO 2180
02160     PRINT L9$;"I HAVE A POINT ON";T
02170     GO TO 3130
02180     IF D1<>D2 GO TO 2350
02190     IF A(25)>1 GO TO 2450
02200     FOR N1=1 TO 4
02210        IF N<N1 GO TO 2350
02220        IF F-T=N1*D1 GO TO 2250
02230     NEXT N1
02240     GO TO 3130
02250     FOR J=1 TO N1-1
02260        IF A(F-J*D1)<-1 GO TO 3130
02270     NEXT J
02280     FOR J=1 TO N1-1
02290        IF A(F-J*D1)>-1 GO TO 2320
02300        LET A(F-J*D1)=0
02310        LET B(2)=B(2)+1
02320     NEXT J
02330     LET D(1)=N1*D1
02340     GO TO 2450
02350     IF D1+D2<>F-T GO TO 2450
02360     IF N=1 GO TO 3130
02370     IF A(F-D1)=-1 GO TO 2410
02380     IF A(F-D2)=-1 GO TO 2410
02390     IF A(F-D1)>-1 GO TO 2430
02400     IF A(F-D2)>-1 GO TO 2430
02410     PRINT L9$;"SORRY; PLEASE INPUT YOUR MOVES SEPARATELY."
02420     GO TO 1590
02430     LET N1=2
02440     LET D(1)=D1+D2
02450     FOR L=1 TO N
02460        IF D(L)=F-T GO tO 2500
02470     NEXT L
02480     PRINT L9$;"YOU DID NOT THROW A";F-T
02490     GO TO 3130
02500     IF H6(1)<3 GOTO 2530
02510     LET C4=F
02520     GOSUB 2660
02530     IF A(T)>-1 GO TO 2560
02540     LET A(T)=0
02550     LET B(Y)=B(Y)+1
02560     LET A(F)=A(F)-1
02570     LET A(T)=A(T)+1
02580     LET D(1)=D(3-L)
02590     LET N=N-N1
02600     IF H6(1)<3 GO TO 2640
02610     IF M$(1)="B" GOTO 2640
02620     LET C4=T
02630     GOSUB 2740
02640     IF H6(1)=2 GOTO 3400
02650     GOTO 2820
02660     IF C4<13 GOTO 2700
02670     LET L4=39+ABS(A(C4))
02680     LET C4=25-C4
02690     GOTO 2710
02700     LET L4=53-ABS(A(C4))
02710     LET C4=32+(C4*3-2)
02720     PRINT L9$;C9$;CHR$(L4);CHR$(C4);" ";H9$
02730     RETURN
02740     IF C4<13 GOTO 2780
02750     LET L4=39+ABS(A(C4))
02760     LET C4=25-C4
02770     GOTO 2790
02780     LET L4=53-ABS(A(C4))
02790     LET C4=32+(C4*3-2)
02800     PRINT L9$;C9$;CHR$(L4);CHR$(C4);Z$(3-Z);H9$;L9$
02810     RETURN
02820     FOR K2=1 TO N1
02830        PRINT L9$;"*"
02840     NEXT K2
02850  NEXT K
02860  GO TO 1630
02870  IF N>0 GO TO 1590
02880  LET Z=2
02890  LET B(1)=A(25)
02900  PRINT
02910  GO TO 1080
02920  
02930  FOR J=7 TO 25
02940     IF A(J)>0 GO TO 3130
02950  NEXT J
02960  IF A(T)<1 GO TO 3130
02970  FOR L=1 TO 2
02980     IF T=D(L) GO TO 3070
02990  NEXT L
03000  FOR J=T+1 TO 6
03010     IF A(J)>0 GO TO 3130
03020  NEXT J
03030  FOR L=1 TO N
03040     IF T<D(L) GO TO 3070
03050  NEXT L
03060  GO TO 3130
03070  LET C4=T
03080  GOSUB 2660
03090  LET A(T)=A(T)-1
03100  LET C(1)=C(1)+1
03110  IF C(1)=15 GO TO 9980
03120  GO TO 2580
03130  PRINT L9$;"ILLEGAL MOVE.";
03140  GO TO 1590
03150  LET T$=MID$(M$(1),1,3)
03160  IF T$="NOM" GO TO 4830
03170  IF T$="CHE" GO TO 2880
03180  IF T$="INF" GO TO 4580
03190  IF T$="QBO" GO TO 3390
03200  IF T$="BOA" GO TO 3670
03210  IF T$="RES" GO TO 4390
03220  IF T$="REF" GO TO 3700
03230  IF T$="ISP" GO TO 4220
03240  IF T$="IBA" GO TO 4290
03250  IF T$="IBO" GO TO 4320
03260  IF T$="INS" GO TO 4760
03270  IF T$="OPT" GO TO 4780
03280  IF T$="ADV" GO TO 4800
03290  IF T$="IDI" GO TO 4100
03300  IF T$="ARR" GO TO 4340
03310  IF T$="IPO" GO TO 4260
03320  IF T$="CON" GO TO 9970
03330  IF T$="STO" GO TO 10500
03340  IF T$<>"DOU" GOTO 3370
03350  LET R9=1									'SET FLAG
03360  GOTO 1630
03370  PRINT L9$;CHR$(34);M$(1);CHR$(34);" IS NOT A LEGAL COMMAND!";
03380  GO TO 1590
03390  PRINT H9$;S9$;
03400  GOSUB 3420
03410  GOTO 1630
03420  FOR J=1 TO 24
03430     IF A(J)=0 GO TO 3480
03440    LET Z3=ABS(A(J))
03450    LET Z4=SGN(A(J))
03460     LET A$(J)=STR$(Z3)+Y$(Z4+2)
03470     GO TO 3490
03480   LET A$(J)="--"
03490  NEXT J
03500  IF H6(1)=1 GOTO 3520
03510  PRINT C9$;CHR$(37);CHR$(32)
03520  PRINT " 24 23 22 21 20 19 18 17 16 15 14 13"
03530  PRINT "------------------------------------"
03540  FOR H=24 TO 13 STEP -1
03550    PRINT " "; A$(H);
03560  NEXT H
03570  PRINT
03580  PRINT
03590  FOR H=1 TO 12
03600    PRINT " "; A$(H);
03610  NEXT H
03620  PRINT
03630  PrINT "------------------------------------"
03640  PRINT "  1  2  3  4  5  6  7  8  9 10 11 12";H9$
03650  RETURN
03660  GO TO 1630
03670  IF H6(1)=2 GOTO 3390
03680  GOSUB 3760
03690  GOTO 1630
03700  IF H6(1)=2 GO TO 3740
03710  GOSUB 3760
03720  GOSUB 4600
03730  GO TO 4700
03740  GOSUB 3440
03750  GO TO 3720
03760  IF H6(1)=1 GOTO 3790
03770  PRINT H9$;S9$;
03780  PRINT C9$;CHR$(37);CHR$(32)
03790  PRINT "24 23 22 21 20 19!18 17 16 15 14 13"
03800  PRINT " -  -  -  -  -  -  -  -  -  -  -  -"
03810 LET M=6
03820  FOR H=1 TO 5
03830     FOR J=24 TO 13 STEP -1
03840        IF H>ABS(A(J)) GO TO 3880
03850        IF M>ABS(A(J)) GOTO 3870
03860	     PRINT TAB(72-3*J);Z$(SGN(A(J))*.5+1.5);
03870        PRINT TAB(73-3*J);Z$(SGN(A(J))*.5+1.5);
03880     NEXT J
03890     PRINT
03900     LET M=M+1
03910  NEXT H
03920  PRINT
03930  PRINT " +  +  +  +  +  +! +  +  +  +  +  +"
03940  PRINT
03950  LET M=10
03960  FOR H=5 TO 1 STEP-1
03970     FOR J=1 TO 12
03980        IF H>ABS(A(J)) GOTO 4020
03990        IF M>ABS(A(J)) GOTO 4010
04000        PRINT TAB(3*J-3);Z$(SGN(A(J))*.5+1.5);
04010        PRINT TAB(3*J-2);Z$(SGN(A(J))*.5+1.5);
04020     NEXT J
04030     PRINT
04040     LET M=M-1
04050  NEXT H
04060  PRINT " -  -  -  -  -  -  -  -  -  -  -  -"
04070  PRINT " 1  2  3  4  5  6! 7  8  9 10 11 12"
04080  PRINT H9$
04090  RETURN
04100  GOSUB 4120
04110  GO TO 1630
04120  INPUT D1,D2
04130  LET N=S=2
04140  IF D1<>D2 GO TO 4160
04150  LET N=S=4
04160  LET D(1)=D1
04170  LET D(2)=D2
04180  LET D1=FNM(D1,D2)
04190  LET D2=D(2)=D(1)+D2-D1
04200  LET D(1)=D1
04210  RETURN
04220  INPUT G,G1
04230  LET A(G)=G1
04240  GOSUB 4480
04250  GO TO 1630
04260  MAT INPUT A
04270  GOSUB 4480
04280  GO TO 1630
04290  INPUT A(25),B(2)
04300  GOSUB 4480
04310  GO TO 1630
04320  INPUT C(1),C(2)
04330  GO TO 1630
04340  FOR J=1 TO 24
04350     PRINT L9$;A(J);
04360  NEXT J
04370  PRINT
04380  GO TO 1630
04390  GOSUB 4410
04400  GO TO 1630
04410  MAT A=T
04420  LET A(25)=B(1)
04430  LET B(2)=-A(0)
04440  GOSUB 4480
04450  LET N=S
04460  GOSUB 4160
04470  RETURN
04480  LET H1=H2=0
04490  FOR J=1 TO 25
04500     IF A(J)<0 GO TO 4530
04510     LET H1=H1+A(J)
04520     GO TO 4540
04530     LET H2=H2-A(J)
04540  NEXT J
04550  LET C(1)=15-H1
04560  LET C(2)=15-H2-B(2)
04570  RETURN
04580  GOSUB 4600'PRINT ROUTINE
04590  GOTO 4700
04600  LET H=A(25)*25
04610  LET L=B(2)*25  
04620  FOR J=1 TO 24
04630    IF A(J)=0 GO TO 4680
04640    IF A(J)<0 GO TO 4670
04650    LET H=H+(J*ABS(A(J)))
04660    GO TO 4680
04670    LET L=L+((25-J)*ABS(A(J)))
04680  NEXT J
04690  RETURN
04700  PRINT L9$;"YOUR THROW IS";D1;",";D2;"        THE DOUBLING CUBE IS ON  ";D9
04710  PRINT L9$;"MEN ON THE BAR.     RUNNING POINTS.     MEN BORNE OFF."
04720  PRINT L9$;"     WHITE  ";A(25);"             ";H;"            ";C(1)
04730  PRINT L9$;"     BLACK  "; B(2);"             ";L;"            ";C(2)
04740  GO TO 1630
04750  
04760  GOSUB 10750
04770  GO TO 1630
04780  GOSUB 11340
04790  GO TO 1630
04800  GOSUB 11650
04810  GO TO 1630
04820  
04830  IF N>0 GO TO 4870
04840  PRINT L9$;"YOU HAVE ALREADY MADE ALL YOUR MOVES."
04850  PRINT L9$;"PRESS RETURN TO MAKE IT MY MOVE."
04860  GO TO 1590
04870  LET S1=N
04880  LET S2=D(1)
04890  LET S3=D1+D2-S2
04900  LET R7=0
04910  LET N=2
04920  MAT S=T
04930  LET S5=D1
04940  LET S6=D2
04950  MAT U=A
04960  LET E(1)=T(0)
04970  LET E(2)=B(2)
04980  LET E(3)=B(1)
04990  LET E(4)=A(0)
05000  IF S=4 GO TO 5020
05010  GOSUB 4410
05020  GOSUB 10530
05030  LET F7=1
05040  GO TO 5370
05050  LET R7=F7=0
05060  LET T(0)=E(1)
05070  LET B(2)=E(2)
05080  LET B(1)=E(3)
05090  LET A(0)=E(4)
05100  MAT A=U
05110  MAT T=S
05120  GOSUB 4480
05130  IF M1$="NO MOVE" GO TO 2880
05140  LET M$=M1$
05150  GOSUB 10670
05160  LET M1$=M$
05170  IF M2$="NO FURTHER MOVE." GO TO 5220
05180  LET M$=M2$
05190  GOSUB 10670
05200  LET M2$=M$
05210  GO TO 5290
05220  LET M2$="NO MOVE."
05230  IF S=4 GO TO 5290
05240  IF S1=2 GO TO 5290
05250  IF D1=S3 GO TO 2880
05260  PRINT L9$;"YOU MUST MOVE THE LARGER DIE IF YOU CAN ONLY MOVE ONE."
05270  GOSUB 4410
05280  PRINT L9$;"THE BOARD HAS BEEN RESET TO BEFORE YOUR MOVE."
05290  LET D(1)=S2
05300  LET N=S1
05310  LET D1=S5
05320  LET D2=S6
05330  PRINT L9$;"A POSSIBLE MOVE FOR YOU WOULD BE."
05340  PRINT L9$;M1$;"  ";M2$
05350  GO TO 1590
05360  REM ***** COMPUTER'S MOVE *****
05370  LET A(0)=-B(2)
05380  LET T=0
05390  FOR I=1 TO 6
05400     IF A(I)<2 GO TO 5420
05410     LET T=T+1
05420  NEXT I
05430  LET U2=36-T^2
05440  LET U2=FNM(U2,.1)
05450  FOR R=1 TO N/2
05460     LET B1=B3=B5=B(1)
05470     LET C3=C2=C(2)
05480     LET V(0)=A(0)
05490     MAT V=A
05500     LET E7=0
05510     LET W1=W2=25
05520     LET P7=-1000000
05530     IF B(1)>0 GO TO 5650
05540     IF R7=1 GO TO 5650
05550     FOR I=1 TO 24
05560        IF A(I)<=0 GO TO 5580
05570        LET T1=I
05580     NEXT I
05590     FOR I=24 TO 0 STEP -1
05600        IF A(I)>=0 GO TO 5620
05610        LET T2=I
05620     NEXT I
05630     IF T1>T2 GO TO 5650
05640     LET R7=1
05650     FOR I=0 TO 18
05660        IF A(I)<0 GO TO 6500
05670     NEXT I
05680     LET E7=1
05690  REM ***** BEARING OFF TWO MEN *****
05700     LET D(1)=25-D1
05710     LET D(2)=25-D2
05720     FOR I=1 TO 2
05730        IF V(D(I))<0 GO TO 5860
05740        FOR J=19 TO D(I)-1
05750           IF V(J)<0 GO TO 5980
05760        NEXT J
05770        FOR J=24 TO D(I)+1 STEP -1
05780           IF V(J)>-1 GO TO 5800
05790           LET D(I)=J
05800        NEXT J
05810        IF V(D(I))<0 GO TO 5860
05820        LET V(D(1))=A(D(1))
05830        LET D(1)=D1
05840        LET M2$=""
05850        GO TO 8380
05860        LET V(D(I))=V(D(I))+1
05870     NEXT I
05880     LET C2=C3+2
05890     GOSUB 8670
05900     LET P7=P
05910     LET C(2)=C2
05920     LET M1$="B-"+STR$(D(1))
05930     LET F4=D(1)
05940     LET M2$="B-"+STR$(D(2))
05950     LET F5=D(2)
05960     LET T4=T5=0
05970     MAT T=V
05980     MAT V=A
05990     LET C2=C3
06000    
06010     LET D(1)=D1
06020     LET D(2)=D2
06030     REM ***** BEAR ONE OFF *****
06040     LET C2=C3+1
06050     FOR I=1 TO 2
06060        LET D1=D(I)
06070        LET D2=25-D(3-I)
06080        FOR J=19 TO 24-D1
06090           IF V(J)>-1 GO TO 6440
06100           IF V(J+D1)>1 GO TO 6440
06110           IF V(J+D1)<1 GO TO 6150
06120           LET B1=B5+1
06130           LET W1=J+D1
06140           LET V(J+D1)=0
06150           LET V(J+D1)=V(J+D1)-1
06160           LET V(J)=V(J)+1
06170           LET K=D2
06180           IF V(K)<0 GO TO 6260
06190           FOR K=19 TO D2-1
06200             IF V(K)<0 GO TO 6400
06210           NEXT K
06220           FOR K=D2+1 TO 24
06230              IF V(K)<0 GO TO 6260
06240           NEXT K
06250           GO TO 6400
06260           LET V(K)=V(K)+1
06270           GOSUB 8670
06280           IF P<=P7 GO TO 6390
06290           LET P7=P
06300           LET M1$=STR$(J)+"-"+STR$(J+D1)
06310           LET F4=J
06320           LET T4=J+D1
06330           LET M2$="B-"+STR$(D2)
06340           LET F5=D2
06350           LET T5=0
06360           LET C(2)=C2
06370           LET B(1)=B1
06380           MAT T=V
06390           LET V(K)=A(K)
06400           LET V(J+D1)=A(J+D1)
06410           LET V(J)=A(J)
06420           LET W1=25
06430           LET B1=B5
06440        NEXT J
06450     NEXT I
06460  
06470     LET D1=D(1)
06480     LET D2=D(2)
06490     GO TO 7200
06500     IF R7=1 GO TO 6680
06510     FOR M=T2 TO 24
06520        LET T8=0
06530        FOR L=1 TO 6
06540           IF M+L>24 GO TO 6640
06550           IF A(M+L)>1 GO TO 6630
06560           FOR T7=1 TO 6
06570              IF M+L+T7>24 GO TO 6630
06580              IF A(M+L+T7)>1 GO TO 6620
06590              LET T8=T8+1
06600              IF A(M+T7)<2 GO TO 6620
06610              LET T8=T8+1
06620           NEXT T7
06630        NEXT L
06640        LET F(M)=(36-T8)*(25-M)/500
06650     NEXT M
06660     IF A9=1 GOTO 12520
06670     IF A9=2 GOTO 12590
06680     LET G8=0
06690     FOR I=19 TO 24
06700        IF V(I)>1 GO TO 6720
06710        LET G8=G8-V(I)
06720     NEXT I
06730     IF G8+C3<>14 GO TO 7200
06740     FOR K=19-D1 TO 18
06750        IF V(K)=-1 GO TO 6780
06760     NEXT K
06770     GO TO 7200
06780     LET C2=C3+1
06790     FOR I=1 TO 2
06800        LET D1=D(I)
06810        LET D2=25-D(3-I)
06820        IF K+D1<19 GO TO 7170
06830        IF V(K+D1)>1 GO TO 7170
06840        IF V(K+D1)<1 GO TO 6880
06850        LET B1=B1+1
06860        LET W1=K+D1
06870        LET V(K+D1)=0
06880        LET V(K+D1)=V(K+D1)-1
06885        LET V(K)=V(K)+1
06890        IF V(D2)<0 GO TO 6970
06900        FOR J=19 TO D2-1
06910           IF V(J)<0 GO TO 7130
06920        NEXT J
06930        FOR J=24 TO D2+1 STEP -1
06940           IF V(J)>-1 GO TO 6960
06950           LET D2=J
06960        NEXT J
06970        LET V(D2)=V(D2)+1
06980        LET E7=1
06990        GOSUB 8670
07000        IF P<=P7 GO TO 7120
07010        LET P7=P
07020        LET M1$=STR$(K)+"-"+STR$(K+D1)
07030        LET F4=K
07040        LET T4=K+D1
07050        LET M2$="B-"+STR$(D2)
07060        LET F5=D2
07070        LET T5=0
07080        IF C2=15 GO TO 9970
07090        LET B(1)=B1
07100        LET C(2)=C2
07110        MAT T=V
07120        LET V(D2)=A(D2)
07130        LET V(K)=A(K)
07140        LET V(K+D1)=A(K+D1)
07150        LET B1=B3
07160        LET W1=25
07170     NEXT I
07180     LET D1=D(1)
07190     LET D2=D(2)
07200     LET C2=C3
07210  REM ***** MOVING TWO PIECE'S *****
07220     FOR I=1 TO 2
07230        FOR K=0 TO 24-D1
07240           IF V(K)>-1 GO TO 7670
07250           IF V(K+D1)>1 GO TO 7660
07260           IF V(K+D1)<1 GO TO 7300
07270           LET B1=B3=B1+1
07280           LET W1=K+D1
07290           LET V(K+D1)=0
07300           LET V(K+D1)=V(K+D1)-1
07310           LET V(K)=V(K)+1
07320           FOR H=K TO 24-D2
07330              IF V(H)>-1 GO TO 7610
07340              IF V(H+D2)>1 GO TO 7600
07350              LET V1=V(H)
07360              LET V2=V(H+D2)
07370              IF V(H+D2)<1 GO TO 7410
07380              LET V(H+D2)=0
07390              LET B1=B3+1
07400              LET W2=H+D2
07410              LET V(H+D2)=V(H+D2)-1
07420              LET V(H)=V(H)+1
07430              GOSUB 8670
07440              IF P<=P7 GO TO 7560
07450              LET P7=P
07460              LET B(1)=B1
07470              LET C(2)=C3
07480              LET M1$=STR$(K)+"-"+STR$(K+D1)
07490              LET F4=K
07500              LET T4=K+D1
07510              LET M2$=STR$(H)+"-"+STR$(H+D2)
07520              LET F5=H
07530              LET T5=H+D2
07540              MAT T=V
07550              LET T(0)=V(0)
07560              LET B1=B3
07570              LET W2=25
07580              LET V(H+D2)=V2
07590              LET V(H)=V1
07600              IF H=0 GO TO 7620
07610           NEXT H
07620           LET V(K+D1)=A(K+D1)
07630           LET V(K)=A(K)
07640           LET B1=B3=B5
07650           LET W1=25
07660           IF K=0 GO TO 7680
07670        NEXT K
07680        LET D1=D(3-I)
07690        LET D2=D(I)
07700     NEXT I
07710  
07720     IF P7=-1000000 GO TO 8070
07730     IF F7=1 GO TO 5050
07740     PRINT L9$;M1$;"  ";M2$;"  ";
07750     IF C(2)=15 GO TO 9980
07760     IF H6(1)=2 GOTO 7970
07770     IF H6(1)=1 GOTO 7970
07780     IF F4=0 GO TO 7810
07790     LET C4=F4
07800     GOSUB 2660
07810     IF F5=0 GO TO 7860
07820     IF F4<>F5 GO TO 7840
07830     LET A(F5)=A(F5)+1
07840     LET C4=F5
07850     GOSUB 2660
07860     MAT A=T
07870     IF T4=0 GOTO 7970
07880     IF T4<>T5 GO TO 7900
07890     LET A(T4)=A(T4)+1
07900     LET C4=T4
07910     GOSUB 2740
07920     IF T5=0 GOTO 7970
07930    IF T4<>T5 GO TO 7950
07940     LET A(T4)=A(T4)-1
07950     LET C4=T5
07960     GOSUB 2740
07970     MAT A=T
07980     LET A(0)=T(0)
07990  NEXT R
08000  IF H6(1)<>2 GO TO 8020
08010  GOSUB 3420
08020  LET B(2)=-A(0)
08030  LET Z=1
08040  GO TO 1040
08050  REM ***** MOVING ONLY ONE DIE *****
08060  REM ***** REGULAR MOVE *****
08070  LET M2$="NO FURTHER MOVE."
08080  LET F5=0
08090  FOR I=1 TO 2
08100     LET D1=D(I)
08110     FOR K=0 TO 24 -D1
08120        IF V(K)>-1 GO TO 8330
08130        IF V(K+D1)>1 GO TO 8320
08140        IF V(K+D1)<1 GO TO 8180
08150        LET B1=B5+1
08160        LET W1=K+D1
08170        LET V(K+D1)=0
08180        LET V(K+D1)=V(K+D1)-1
08190        LET V(K)=V(K)+1
08200        GOSUB 8670
08210        IF P<=P7 GO TO 8290
08220        LET P7=P
08230        LET M1$=STR$(K)+"-"+STR$(K+D1)
08240        LET T4=K+D1
08250        LET F4=K
08260        LET B(1)=B1
08270        MAT T=V
08280        LET T(0)=V(0)
08290        LET V(K)=A(K)
08300        LET V(K+D1)=A(K+D1)
08310        LET W1=25
08320        IF K=0 GO TO 8590
08330     NEXT K
08340  REM ***** BEARING OFF *****
08350     FOR J=1 TO 18
08360        IF A(J)<0 GO TO 8590
08370     NEXT J
08380     LET K=25-D1
08390     IF V(K)<0 GO TO 8480
08400     LET D1=K
08410     FOR K=19 TO D1-1
08420        IF V(K)<0 GO TO 8590
08430     NEXT K
08440     FOR K=D1+1 TO 24
08450        IF V(K)<0 GO TO 8480
08460     NEXT K
08470     GO TO 8590
08480     LET V(K)=V(K)+1
08490     LET C2=C3+1
08500     GOSUB 8670
08510     IF P<=P7 GO TO 8580
08520     LET P7=P
08530     LET M1$="B-"+STR$(K)
08540      LET T4=0
08550     LET F4=K
08560     LET C(2)=C2
08570     MAT T=V
08580     LET V(K)=A(K)
08590     IF P7<>-1000000 GO TO 7730
08600  NEXT I
08610  LET M2$=""
08620  LET M1$="NO MOVE"
08630  LET F4=0
08640  MAT T=A
08650  LET T(0)=A(0)
08660  GO TO 7730
08670  REM ***** SUBTEST *****
08680  LET P=0
08690  IF E7=0 GO TO 8760
08700  GOSUB 8950
08710  LET P=P/100
08720  GOSUB 9090
08730  GOSUB 9830
08740  LET P=P+C2
08750  RETURN
08760  IF R7=1 GO TO 8810
08770  GOSUB 8840
08780  GOSUB 8950
08790  GOSUB 9000
08800  RETURN
08810  GOSUB 9890
08820  RETURN
08830 
08840  LET P=P-(K*D1+H*D2)/40
08850  LET P=P+F(K)-F(K+D1)+F(H)-F(H+D2)
08860  IF V(K)<0 GO TO 8880
08870  LET P=P-FNF(K)
08880  IF A(K+D1)<0 GO TO 8900
08890  LET P=P+FNF(K+D1)
08900  IF V(H)<0 GO TO 8920
08910  LET P=P-FNF(H)
08920  IF A(H+D2)<0 GO TO 8940
08930  LET P=P+FNF(H+D2)
08940  RETURN
08950  FOR M=1 TO 24
08960     IF V(M)>-3 GO TO 8980
08970     LET P=P+(V(M)+2)^3/V(M)^2
08980  NEXT M
08990  RETURN
09000  FOR L=19 TO 24
09010     IF V(L)<>-1 GO TO 9030
09020     LET P=P-1
09030  NEXT L
09040  
09050  FOR L=17 TO 22
09060     IF V(L)>-2 GO TO 9080
09070     LET P=P+(10-ABS(19-L))/2
09080  NEXT L
09090  LET T=0
09100  FOR M=19 TO 24
09110     IF V(M)>-2 GO TO 9130
09120     LET T=T+1
09130  NEXT M
09140  LET U1=36-T^2
09150  LET U1=FNM(U1,.1)
09160  REM ***** FOR BLOTS *****
09170  IF B1>0 GO TO 9490
09180  FOR L=1 TO 23
09190     IF V(L)<>-1 GO TO 9470
09200     LET T=0
09210     LET G2=0
09220     FOR T6=1 TO 6
09230        IF L+T6>24 GO TO 9290
09240        IF V(L+T6)<1 GO TO 9280
09250        LET G2=G2+1
09260        LET T=T+13-2*G2
09270        LET G(G2)=T6
09280     NEXT T6
09290     FOR T7=1 TO 6
09300        IF L+T7>24 GO TO 9460
09310        FOR T9=1 TO G2
09320            IF T7=G(T9) GO TO 9450
09330        NEXT T9
09340        IF V(L+T7)<-1 GO TO 9450
09350        FOR T8=1 TO T7
09360           IF L+T7+T8>24 GO TO 9450
09370           FOR T9=1 TO G2
09380              IF G(T9)=T8 GO TO 9440
09390           NEXT T9
09400           IF V(T7+T8+L)<1 GO TO 9440
09410           LET T=T+2
09420           IF T7<>T8 GO TO 9440
09430           LET T=T-1
09440        NEXT T8
09450     NEXT T7
09460     LET P=P-(L*T/36+T/U2)
09470  NEXT L
09480  RETURN
09490  IF B1>1 GO TO 9740
09500  LET G2=0
09510  FOR L=19 TO 24
09520     IF V(L)<-1 GO TO 9570
09530     LET G2=G2+1
09540     LET G(G2)=L
09550     IF V(L)>-1 GO TO 9570
09560     LET P=P-L*11/U2*(15-C2)/15
09570  NEXT L
09580  FOR M=1 TO 23
09590     IF V(M)<>-1 GO TO 9720
09600     LET T=0
09610     FOR T7=1 TO 6
09620        IF M+T7>24 GO TO 9700
09630        IF V(M+T7)>0 GO TO 9680
09640        FOR T8=1 TO G2
09650           IF G(T8)=M+T7 GO TO 9680
09660        NEXT T8
09670        GO TO 9690
09680        LET T=T+1
09690     NEXT T7
09700     LET T=12*T-T*T
09710     LET P=P-(M*T/36+T/U2)
09720  NEXT M
09730  GO TO 9800
09740  LET G2=0
09750  FOR L=19 TO 24
09760     IF V(L)<>-1 GO TO 9790
09770     LET P=P-(11-G2)*(L/36+1/U2)
09780  LET G2=G2+2
09790  NEXT L
09800  LET P=P+50-W1-W2
09810  LET P=P+B1*36/U1
09820  RETURN
09830  FOR L=19 TO 24
09840     IF V(L)>-1 GO TO 9860
09850     LET P=P-V(L)*L/30
09860  NEXT L
09870  RETURN
09880  RETURN
09890  FOR I7=19 TO 23
09900     LET P=P-V(I7)*(24-17)^2/3
09910  NEXT I7
09920  FOR M=2 TO 18
09930     IF V(M)>-1 GO TO 9950
09940     LET P=P+(19-M)*V(M)
09950  NEXT M
09960  RETURN
09970  LET Z=2
09980  IF Z=2 GO TO 10140
09990  PRINT L9$;"CONGRATULATIONS."
10000  IF C(2)=0 GO TO 10040
10010  PRINT L9$;"YOU WON A SINGLE GAME."
10020  LET W9=W9+D9								'STORE WHITES TOTAL SCORE
10030  GOTO 10270
10040  FOR J=0 TO 6
10050     IF A(J)<0 GO TO 10100
10060  NEXT J
10070  PRINT L9$;"YOU WON A GAMMON (DOUBLE GAME)."
10080  LET W9=W9+(D9*2)
10090  GOTO 10270
10100  PRINT L9$;"YOU WON A BACKGAMMON (TRIPLE GAME)."
10110  PRINT L9$;"MY PRIDE IS SHATTERED."
10120  LET W9=W9+(D9*3)
10130  GOTO 10270
10140  PRINT L9$;"YOU PLAY WELL FOR A ....HUMAN...BUT,"
10150  IF C(1)=0 GO TO 10190
10160  PRINT L9$;"I WON A SINGLE GAME."
10170  LET B9=B9+D9
10180  GOTO 10270
10190  FOR J=19 TO 25
10200     IF A(J)>0 GO TO 10250
10210  NEXT J
10220  PRINT L9$;"I WON A GAMMON (DOUBLE GAME)."
10230  LET B9=B9+(D9*2)
10240  GOTO 10270
10250  PRINT L9$;"I WON A BACKGAMMON (TRIPLE GAME)."
10260  LET B9=B9+(D9*3)
10270  IF W9>B9 GOTO 10330
10280  IF W9=B9 GOTO 10310
10290  PRINT L9$;"I AM WINNING BY ";B9;" POINTS TO YOUR ";W9
10300  GOTO 10340
10310  PRINT L9$;"WE ARE DRAWN AT ";B9;" POINTS EACH!"
10320  GOTO 10340
10330  PRINT L9$;"YOU ARE WINNING BY ";W9;" POINTS TO MY ";B9
10340  PRINT L9$;"I WILL GIVE YOU A REMATCH."
10350  PRINT L9$;"DO YOU WANT IT?";
10360  INPUT N$
10370  CHANGE N$ TO N
10380  IF ABS(94-N(1))=16 GO TO 10500
10390  IF ABS(105-N(1))=16 GO TO 10460
10400  IF Z=1 GO TO 10430
10410  PRINT L9$;"DON'T BE A SORE LOSER!"
10420  GO TO 10440
10430  PRINT L9$;"JUST BECAUSE YOU HAPPENED TO BEAT ME DON'T RUB IT IN."
10440  PRINT L9$;"JUST ANSWER - 'YES' OR 'NO'"
10450  GO TO 10360
10460  LET C(1)=C(2)=B(1)=B(2)=R7=0
10470  RESTORE
10480  GO TO 390
10490  DATA -2,0,0,0,0,5,0,3,0,0,0,-5,5,0,0,0,-3,0,-5,0,0,0,0,2,0
10500  PRINT
10510  PRINT L9$;"SCARED?"
10520  STOP
10530  REM "SWITCHBD"
10540  FOR J=1 TO 12
10550     LET G=A(J)
10560     LET A(J)=-A(25-J)
10570     LET A(25-J)=-G
10580  NEXT J
10590  LET G=B(1)
10600  LET B(1)=B(2)
10610  LET B(2)=G
10620  LET G=C(1)
10630  LET C(1)=C(2)
10640  LET C(2)=G
10650  RETURN
10660  REM SWITCHMV
10670  LET G=INSTR(M$,"-")
10680  LET T=25-VAL(MID$(M$,G+1))
10690  LET F$=MID$(M$,1,G-1)
10700  IF F$="B" GO TO 10730
10710  LET F=25-VAL(F$)
10720  LET F$=STR$(F)
10730  LET M$=F$+"-"+STR$(T)
10740  RETURN
10750 REM "INSTRUCT"
10760 LET A$=CHR$(34)
10770 PRINT
10780 PRINT L9$;"YOU ARE WHITE (CIRCLES) I AM BLACK. YOU ARE MOVING YOUR"
10790 PRINT "PIECES FROM 24 TO 1. THE FORMAT OF YOUR MOVE IS:-"
10800 PRINT
10810 PRINT "   P-Q-N"
10820 PRINT ""
10830 PRINT " P IS THE POINT MOVED FROM."
10840 PRINT " Q IS THE POINT MOVED TO."
10850 PRINT " N IS THE NUMBER OF MEN BEING MOVED FROM P TO Q."
10860 PRINT "IF N=1 THE FINAL ";A$;"-1";A$;" CAN BE OMITTED."
10870 PRINT ""
10880 PRINT "PRESS RETURN KEY AFTER ENTERING MOVE. MORE THAN ONE MOVE"
10890 PRINT "MAY BE ENTERED AT ONE TIME, SEPARATED BY COMMAS."
10900 PRINT
10910 PRINT "EXAMPLE:-"
10920 PRINT "   IF IN THE BEGINNING POSITION YOU THREW A 5 AND 3"
10930 PRINT "   YOUR MOVE MIGHT BE:-"
10940 PRINT
10950 PRINT "   8-3,6-3   OR"
10960 PRINT "   24-16   (24-21,21-16 IS ALSO FINE)"
10970 PRINT
10980 PRINT "   WITH DOUBLE THREES (4 THREES TO MOVE) YOUR MOVE MIGHT BE:-"
10990 PRINT
11000 PRINT "   13-7-2   OR"
11010 PRINT "   8-5-2,6-3-2   OR"
11020 PRINT "   24-15,13-10"
11030 PRINT ""
11040 PRINT "WHEN COMING IN FROM THE BAR TYPE:-"
11050 PRINT "   25-<POINT MOVED TO>-<NUMBER OF TIMES>"
11060 PRINT "I.E. YOUR BAR IS CALLED POINT 25; MINE IS CALLED POINT 0."
11070 PRINT
11080 PRINT "WHEN BEARING MEN OFF TYPE:-"
11090 PRINT "   B-<POINT BEARING OFF FROM>-<NUMBER OF TIMES>"
11100 PRINT
11110 PRINT "WITH A 4 AND 2 YOU MAY NOT TYPE:-"
11120 PRINT "   B-6     BUT RATHER"
11130 PRINT "   6-4,B-4   OR   6-2,B-2"
11140 PRINT
11150 PRINT "I WILL KNOW WHEN I AM HIT, YOU NEED NOT TYPE ANYTHING."
11160 PRINT
11170 PRINT "I WILL PRINT AN ASTERISK FOR EACH INDIVIDUAL MOVE OF"
11180 PRINT "YOURS THAT I RECORD. THUS IF YOU MOVE ON A DOUBLE 6 IS:-"
11190 PRINT "   24-18-3,13-7"
11200 PRINT "I WILL PRINT 2 ASTERISKS SHOWING I HAVE MOVED 24-18 TWICE"
11210 PRINT "AND THEN PRINT:-"
11220 PRINT"   NO PIECE ON 24"
11230 PRINT "  ILLEGAL MOVE"
11240 PRINT "AFTER WHICH I WILL IGNORE THE REST OF YOUR INPUT LINE"
11250 PRINT "AND WAIT FOR NEW INPUT."
11260 PRINT
11270 PRINT "IF YOU HAVE MOVED AS MUCH AS YOU CAN AND HAVE NOT USED"
11280 PRINT "UP YOUR DICE, YOU MUST THEN TYPE:-"
11290 PRINT "   NOMOVE"
11300 PRINT "THE RUNNING POINTS ARE THE TOTAL # OF DICE POINTS"
11310 PRINT "REQUIRED TO ROLL,TO BEAR OFF ALL THE MEN."
11320 PRINT
11330 RETURN
11340 REM OPTIONS
11350 PRINT
11360 PRINT "                     OPTIONS."
11370 PRINT
11380 PRINT " BOARD     PRINTS BOARD."
11390 PRINT " QBOARD    PRINTS QUICK BOARD."
11400 PRINT " ARRAY     PRINTS THE # OF PIECES ON EACH OF THE 24 POINTS."
11410 PRINT "           NEGATIVE WHEN MINE."
11420 PRINT " INFO      PRINTS DICE THROWN,MEN ON BAR,MEN BORNE OFF"
11430 PRINT "           AND RUNNING POINTS."
11440 PRINT " RESET     RETURNS TO POSITION BEFORE YOUR MOVE."
11450 PRINT "           (E.G. IF YOU CHANGE YOUR MIND BEFORE MY MOVE.)"
11460 PRINT
11470 PRINT " CONCEDE   CONCEDES THE GAME."
11480 PRINT
11490 PRINT " INS       PRINTS INSTRUCTIONS."
11500 PRINT " OPTION    PRINTS THESE OPTIONS."
11510 PRINT " ADVOPT    PRINTS ADVANCED OPTIONS (CHANGING BOARD, ETC.)"
11520 PRINT " DOUBLE    WILL ENABLE YOU TO DOUBLE THE CUBE (POINTS PLAYED FOR)"
11530 PRINT "           THE NEXT TIME IT IS YOUR MOVE BEFORE THE DICE ARE ROLLED"
11540 PRINT "           ONCE YOU HAVE DOUBLED THE ODDS YOU CANNOT RE-DOUBLE UNTIL"
11550 PRINT "           YOU ARE DOUBLED BY ME. IF EITHER OF US DOES NOT ACCEPT THE"
11560 PRINT "           DOUBLE THAT IS THE END OF THAT GAME!"
11570 PRINT " REFRESH   WILL REFRESH THE INTIRE SCREEN USE FOR "
11580 PRINT "           VIDEO DISPLAYS ONLY"
11590 PRINT
11600 PRINT " AN AUTOMATIC DOUBLE OCCURS WHEN THE DICE ARE EQUAL IN THE INITIAL ROLL"
11610 PRINT
11620 PRINT " YOU NEED ONLY TYPE THE FIRST THREE LETTERS."
11630 PRINT
11640 RETURN
11650 REM ADVOPTIONS
11660 LET A$=CHR$(34)
11670 PRINT
11680 PRINT "               ADVANCED OPTIONS"
11690 PRINT
11700 PRINT " IPOS      PERMITS INPUT OF ARBITRARY POSITION."
11710 PRINT "           TYPE # OF PIECES ON EACH POINT (POSITIVE YOURS,"
11720 PRINT "           NEGATIVE MINE),1 TO 25, SEPERATED BY COMMAS."
11730 PRINT "           LAST # IS THE # OF PIECES YOU HAVE ON THE BAR."
11740 PRINT " ISPOS     PERMITS CHANGING # OF MEN ON ANY SINGLE POINT."
11750 PRINT "           INPUT TWO #'S SEPARATED BY A COMMA"
11760 PRINT "           1)A # BETWEEN 1 AND 24 INCLUSIVE"
11770 PRINT "           2)THE # OF MEN YOU WANT ON THAT POINT(NEG FOR ME)"
11780 PRINT " IBAR      PERMITS CHANGING # OF MEN ON THE BAR."
11790 PRINT "           INPUT TWO NONNEGATIVE #'S"
11800 PRINT "           1) YOUR MEN ON THE BAR,"
11810 PRINT "           2) MY MEN ON THE BAR."
11820 PRINT " IBORNE    PERMITS # OF MEN BORNE OFF."
11830 PRINT "           INPUT TWO NONNEGATIVE #'S,"
11840 PRINT "           1) YOUR MEN BORNE OFF,"
11850 PRINT "           2) MY MEN BORNE OFF."
11860 PRINT " IDICE     PERMITS CHANGING THROW."
11870 PRINT "           INPUT A NEW THROW:- <DIE>,<DIE>"
11880 PRINT "           YOU WILL HAVE A FULL TURN WITH THE NEW DICE."
11890 PRINT " CHEAT     LETS YOU CONTINUE WITH MY MOVE WITHOUT ENDING YOURS"
11900 PRINT ""
11910 PRINT " THE MEN BORNE OFF ARE RECONFIGURED TO KEEP 15 PIECES ON"
11920 PRINT " EACH SIDE AFTER CALLING IPOS ,ISPOS , OR IBAR."
11930 PRINT
11940 PRINT A$;"NOMOVE";A$;"RETURNS WHAT THE COMPUTER CONSIDERS TO BE"
11950 PRINT "YOUR BEST MOVE.DO NOT USE IT IMMEDIATELY AFTER CALLING-"
11960 PRINT "IPOS,ISPOS,OR IBAR. IN FACT IT IS BETTER NEVER TO USE "
11970 PRINT "IT AFTER IBORNE."
11980 PRINT
11990 PRINT "YOU MAY LIST THESE COMMANDS ON ONE LINE, AFTER WHICH THE"
12000 PRINT "FIRST";A$;"?";A$;" WILL REFER TO THE FIRST COMMAND"
12010 PRINT "THAT INPUTS ETC..."
12020 PRINT " EXAMPLE:-"
12030 PRINT "? ISPOS,IDICE,24-18,CHEAT,18-15"
12040 PRINT "? 18,-1"
12050 PRINT "? 6,3"
12060 PRINT
12070 PRINT "   I WILL MOVE YOUR PIECE 24-18 AND CONTINUE TO MY MOVE."
12080 PRINT "   I WILL NOT LOOK AT THE REST OF THE LINE AFTER CHEAT"
12090 PRINT "   GO DIRECTLY TO MY MOVE."
12100 RETURN
12110 IF D8<>2 GOTO 12150
12120 PRINT " IT IS NOT YOUR TURN TO DOUBLE!"
12130 LET R9=0
12140 GOTO 12210'EXIT
12150 PRINT " DO YOU STILL WISH TO DOUBLE Y OR N";
12160 INPUT M9$
12170 IF MID$(M9$,1,1)="N" GOTO 12200
12180 LET F7=1
12190  GOSUB 12220
12200 LET F7=R9=0
12210 RETURN
12220 IF D9=64 GOTO 12240
12230 GOTO 12270
12240 IF F7=0 GOTO 12850
12250 PRINT " THE CUBE IS AT THE MAXIMUM, NO MORE DOUBLING!";
12260 GOTO 12850
12270  LET U9=20				'SET REFERENCE VALUES
12280 LET U8=15
12290 LET A9=1
12300  GOSUB 4600
12310 LET X9=H-L
12320 IF FNM(L,H)>100 GOTO 12430
12330 IF FNM(L,H)>80 GOTO 12410
12340 IF FNM(L,H)>70 GOTO 12390
12350 IF FNM(L,H)>60 GOTO 12370
12360 GOTO 12460
12370 LET U9=U9-4
12380 LET U8=U8-3
12390 LET U8=U8-3
12400 LET U9=U9-4
12410 LET U9=U9-4
12420 LET U8=U8-3
12430 IF X9>=U9 GOTO 12680
12440 IF X9>=U8 GOTO 12460
12450 GOTO 12630
12460 IF R7=1 GOTO 12740
12470 LET P9=M9=0
12480 LET X9=T2
12490 LET T2=T1
12500  GOSUB 10530
12510 GOTO 6510
12520 FOR L=1 TO 24
12530   LET P9=P9+F(L)
12540 NEXT L
12550 LET T2=X9
12560  GOSUB 10530
12570 LET A9=2
12580 GOTO 6510
12590 FOR L=1 TO24
12600   LET M9=M9+F(L)
12610 NEXT L
12620 IF (P9/M9)*3>2.9 GOTO 12680
12630 IF F7=0 GOTO 12850
12640 PRINT " I ACCEPT THE DOUBLE, THE CUBE IS NOW ON ";D9*2
12650 LET D8=2
12660 LET D9=D9*2
12670 GOTO 12850
12680 IF F7=1 GOTO 12740
12690 PRINT " I DOUBLE! THE CUBE WILL BECOME ";D9*2;"DO YOU ACCEPT Y OR N";
12700 INPUT M9$
12710 IF MID$(M9$,1,1)="N" GOTO 10140
12720 LET D8=1
12730 GOTO 12660
12740 IF E7=1 GOTO 12780
12750 IF E8=1 GOTO 12800
12760 IF B(2)>A(25) GOTO 12800
12770 GOTO 12630
12780 IF E8=1 GOTO 12760
12790 GOTO 12630
12800 IF C(2)>=C(1)+2 GOTO 12630
12810 IF F7=0 GOTO 12850
12820 PRINT " I DO NOT ACCEPT YOUR DOUBLE!"
12830 PRINT
12840 GOTO 9990
12850 LET A9=0
12860 RETURN
12870  IF  H6(1)<>1 GOTO 12900
12880 LET N(1)=N(2)=N(3)=N(4)=N(5)=0
12890  GOTO 13020
12900  IF H6(1)=4 GOTO 12970
12910  LET N(1)=27
12920  LET N(2)=72
12930  LET N(3)=74
12940  LET N(4)=75
12950  LET N(5)=89
12960  GOTO 13020
12970  PRINT "PLEASE INPUT THE CHARACTERS THAT ARE USED FOR THE FOLLOWING CONTROLS";
12980  PRINT " SEPERATED BY COMAS"
12990  PRINT "ESC(ALT).....HOME.....EOS.....EOL.....CURSOR CONTROL."
13000  INPUT M1$
13010  CHANGE M1$ TO N
13020  RETURN
13030  END