Qa **** GAMMON ****a **** A SIMULATION OF THE GAME OF BACKGAMMON ****aa(a2 WRITTEN BY: PAUL VON AUTENRIEDa< MODIFIED FOR MBASIC BY: KEVIN REDDEN&bA FURTHER MODS BY: BRUCE RATOFF,bFjbP FOR MORE INFORMATION, SEE CREATIVE COMPUTING, JUNE 1978pbZbd A(),B(),S( )bn FILES DEBTbxL7:L6:X5:L:S1:S2:T1:T2:H1:G:P2:D5bD9bB$"-" c I :A(I):B(I): I'c I  :S(I): INc "DO YOU WANT ANY INSTRUCTIONS ";Wc A$pc (A$,)"N" vcc "BACKGAMMON : MY CHIPS ARE REPRESENTED BY - SIGNS, YOUR"c " CHIPS BY A + SIGN. INPUT YOUR MOVES IN THE FORMAT FROM">d " POINT #, TO POINT #, FROM POINT #, TO POINT #, FOR EACH"d " MOVE. EXAMPLE: 5,7,12,17 WOULD BE THE MOVE FOR DICE ROLLS"d " OF 2 AND 5; MOVING ONE CHIP FROM POINT 5 TO POINT 7, AND"d " ANOTHER FROM POINT 12 TO POINT 17."1e " THE BAR IS REPRESENTED BY 0, YOUR HOME IS 25, MY"Ge" " HOME IS 0."e, " IF AT ANY TIME, YOU CARE TO DOUBLE, YOU WILL"e6 " BE ALLOWED 5 SECONDS IMMEDIATELY AFTER THE BOARD"e@ " PRINTOUT TO INPUT A 1, INDICATING YOU WISH TO CHECK">fJ " WHAT VALUE THE CUBE HAS, OR A 2, SUGGESTING DOUBLING THE"QfT " STAKES."Wf^fh "HIT RETURN KEY TO CONTINUE:";QQ$frf|ffA(): B(): A( ): B( )fA(): B()fA(): B()#g  : X: **** PRINT "HAVE YOU PLAYED WITH ME BEFORE";,g A$Eg (P$,)"Y" \g **** READ #1,1tg **** READ #1,D8gD8D8g "YOUR USER NUMBER IS ";D8g #,;D8gD7D8g  g "WHAT IS YOUR USER NUMBER ";g D7g& #,D7;D4h0 D4 N^h: "YOU OWE ME ";D4;"CENTS. OBVIOUSLY YOU LIKE TO MOVE DEEPER INTO DEBT."hhD XhN "I OWE YOU ";D4;"CENTS. NICE OF YOU TO RETURN."hXX((()))hbY((()))hl "YOUR ROLL IS A ";X;"AND MY ROLL IS A ";Y;"."iv XY iD9D9Di "THE DOUBLING CUBE IS NOW AT ";D9Ni X^i YX qi "YOU START."ziD1XiD2Yi iD1((()))iD2((()))i H1 B(D1) B(D2) j "YOUR ROLL IS ";D1;"AND";D2;". WHAT IS YOUR MOVE";#j (5j D1D2 Gj  M1,M2,N1,N2Xj L7 pj  M1 M2 Rj* M2M1D1 Rj4 M2M1D2 pj> "NICE TRY. NEXT TIME I WILL LOAD THE DICE! REINPUT!!!!";jH  jR N1 N2 k\ N2N1D2 >kf 5kp N1 N2 Kkz N2N1D1 >ik B(M2) B(N2) >k M1 M2 k N1 N2 k M1 N1 H1 >k M1 M2 k M1 k A(M1) > lA(M1)A(M1)lA(M2)A(M2),l M1 8lH1H1Pl N1 N2 8al N1 ul A(N1) >lA(N1)A(N1)lA(N2)A(N2)l$ N1 8l.H1H1l8 M1 M2 tlB B(M2) tlLB(M2)B(M2)lVGGm` "YOU HIT ME!!!!"'mj M2N2 ?mt N2 N1 Sm~ B(N2) emB(N2)B(N2)omGGm "YOU HIT ME!!!!"m "YOUR MOVE IS COMPLETED."m $m m "YOUR ROLL IS ";D1;"AND ";D2;" BUT YOU CAN NOT MOVE!!"n ( n  4n COMPUTER MOVE DETERMINATION ******=nC1XFnC2YPn 2nn S1: S2S1: T1S2: T2T1n I  :S(I): InC1((()))n(C2((()))n2 n< "MY ROLL IS ";C1;"AND ";C2nF G oP L6 hoZ C1C2 h&od C1C2 /onZC29oxC2C1BoC1ZNoL5C2XoI1ro IC1 (C2C1)o B(I)I1 B(I) o B(IC1) o A(IC1) o IoI1I1o I1 ro I1 2o p B(I(C2C1)) -p A(IC1) ,@p "I GOT YOU."VpA(IC1)A(IC1)bp"H1H1rp,B(I)B(I)p6B(IC1)B(IC1)p@B(I(C2C1))B(I(C2C1))pJS1IpTS2IC1: T2S2p^T1I(C2C1)ph  prL5 p| I L5 q B(I) "q C1 8q A(IC1) 0Iq C2 _q A(IC2) uq IC1C2 q A(IC1C2) q A(IC1) q Rq A(IC2) q 4q Iq L5 C2 qL5C2r I1  /r I1 C1 C2 9r& 2Or0B(IC1)B(IC1)_r:B(I)B(I)urDA(IC1)A(IC1)rNH1H1rX "I TOOK YOUR CHIP AT ";IC1rbL5C2rlS1IrvS2IC1rC1r r L6 hr C2  s sB(IC2)B(IC2))sB(I)B(I)?sA(IC2)A(IC2)KsH1H1ms "I TOOK YOUR CHIP AT ";IC2ysL5C1sT1IsT2IC2sC2s  s L6 hs  C1  s* s4ZC2s>C2C1sHC1ZsR IC1C2 t\B(IC1C2)B(IC1C2)+tfB(I)B(I)GtpA(IC1C2)A(IC1C2)StzH1H1\tS1IotS2IC1: T1S2~tT2IC1C2t "I TOOK YOUR CHIP AT ";IC1C2tC1: C2C1t C1 C2  t C1 C2  t C2 tZC2 uC2C1uC1Z$u IC1 7u B(I)  Mu B(IC1) B Uu I^u ZC2hu$ C2C1qu. C1Z{u8  uB B(I)B(I)uL B(IC1)B(IC1)uV S1 ~ u` T1Iuj T2IC1ut  u~ S1Iu S2IC1 v COMPUTER MOVE PRINTOUT *****v S1T2  &v Z1S10v Z2S2:v S1T1Dv S2T2Nv T1Z1Xv T2Z2v "MY MOVE IS ";S1;",";S2;"AND";T1;",";T2v "STATUS :"v  v v PRINTOUT ******v F2v P v( Vv2 v< wF " 24 23 22 21 20 19 18 17 16 15 14 13"GwP " ....................................."RwZ );fwd H2F2 P Vzwn A(H2)  wx "###";A(H2);w **** IMAGE #,SDXw  w B(H2)  w "###";B(H2);w  w "###";;x **** IMAGE #,XDX"x H2  3x H2  =x  Ix );Ux H2: gx H2 J mx x );B$;: "# +#";G,H1: x **** IMAGE X,A,DX,SDx" Vx, P x6 F2x@ Z yJ " ....................................."3yT " 1 2 3 4 5 6 7 8 9 10 11 12": Ty^  : **** PRINT LIN(-2)fyh ENTER 5,R1,D5yr D5 OF 3010,| ,$y| "THE DOUBLING CUBE IS AT ";y D9  y D9;". YOU MAY DOUBLE IF YOU WISH."y D5y h z D9;"IT IS MY TURN TO DOUBLE."z D5(z .z Ez SAFE MOVE ******Zz I L5 mz B(I) v z C1 C2  z IC1C2  z B(IC1C2) A(IC1)  z B(IC1C2) A(IC2) z z C1 : {& B(IC1)  {0 C2 v 3{: B(IC2) \ I{D A(IC1) l _{N IC1C2 v x{X B(IC1C2) v {b  {l A(IC2) B(IC1C2) z {v I{ I1I1{ |{ C2  { IC1C2 v | B(IC1C2)  !| B(IC1C2)B(IC1C2)1| B(I)B(I):| S1IM| S2IC1: T2S2\| T1IC1C2f|  v| B(I)B(I)| B(IC1)B(IC1)| S1I| S2IC1| C1| |* L6 h|4 L5C2|> C2  |H B(I) : |R v }\ C1  &}f IC1C2  ?}p B(IC1C2)  [}z B(IC1C2)B(IC1C2)k} B(I)B(I)t} S1I} S2IC2: T1S2} T2IC1C2}  } B(I)B(I)} B(IC2)B(IC2)} T1I} T2IC2} C2} } L6 h ~ L5C1~ C1  &~ v B~ PLAYER DOUBLES ******`~$ M1,M2,M3,M4,M5,M6,M7,M8q~. L7 ~8 M1 M2 `~B M2M1D1 `~L "NICE TRY. NEXT TIME, I WILL LOAD THE DICE. REINPUT!!!!";~V $` M3 M4 tj M4M3D1 L/t M5 M6 E~ M6M5D1 L] M7 M8 s M8M7D1 L B(M2) B(M4) B(M6) B(M8) L M1 M2  M1  A(M1) LA(M1)A(M1)A(M2)A(M2) M1 #H1H1; M3 M4 2L M3 ` A(M3) Lr A(M3)A(M3)A(M4)A(M4) M3 2(H1H12 M5 M6 xʀ< M5 ZހF A(M5) LPA(M5)A(M5)ZA(M6)A(M6)d M5 xnH1H17x M7 M8 H M7 \ A(M7) LnA(M7)A(M7)A(M8)A(M8) M7 H1H1 B(M2) āB(M2)B(M2)΁GG "YOU HIT ME !!!!" B(M4)  B(M4)B(M4)GG/ "YOU HIT ME !!!!"D B(M6) 6VB(M6)B(M6)`"GGx, "YOU HIT ME !!!!"6 B(M8) ^@B(M8)B(M8)JGGT "YOU HIT ME !!!!"˂^ h COMPUTER DOUBLES ******rX3: LX3| I  :S(I): I#C3C1: C4C3/L5C1? IL5 R B(I) h A(IC1)  I(C1)  A(I(C1)) C1C1HIX3 D׃ B(IC1)  B(I) X4I  H X4 X5(& B(H) \>0 A(HC1) \T: A(HC1) b{D "I HIT YOUR CHIP AT POINT ";HC1NH1H1XA(HC1)b X3 vlC1C1̄vS()HC1: S()S()℀S()H: S()S()B(H)B(H) X3 C1C2&B(HC1)B(HC1)8 X3 DC1C1OIHC1Y  cX5sB(I)B(I)B(IC1)B(IC1) A(IC1)  ƅ "I HIT YOUR CHIP AT POINT ";IC1҅ H1H1A(IC1) S()I: S()S()*S()IC1: S()S()"4 X5 H2>C3: C4C3BHC1: C2C1LR T\ Hhf X4I tpX4C4~z \  I  L LL  COMPUTER DOUBLES SAFE MOVE ******  C1 C2 C3 C4 7 C1 C2 C3 C4 FF1: FF1P _F1: FF1kL5C4 I L5  B(I)  A(IC4) $ A(IC4) L. "I HIT YOUR CHIP AT POINT ";IC48H1H1BA(IC4)LB(IC4)B(IC4)&VB(I)B(I)7`S((F))IGjS(F)IC4QtFFl~ F B(I) L F B(I)   I I  ň S(I)S(I) ӈZ3S(I)Z4S(I)S(I)S(I)S(I)S(I)S(I)Z3S(I)Z4' / Ie  "MY MOVE IS";S();",";S();"AND";S();",";S(); "AND";S();",";S();"AND";S();",";S() (  ̉2 COMPUTER FARTHEST MOVE ******Չ<C9F C2 dPL5C2Z ndL5C1nX1x , L6 hA I L5 V B(I)X1 g C2 } A(IC2) B(I)B(I)B(IC2)B(IC2)T1IT2IC2C2͊L5C1ފ C1   A(IC1)  I X1 "X1$"X1X15, X1 M6 C1 C9 ^V@C9_JC2iT d{^ C1 |hS1: S2S1r  | C2 T1: T2T1  ދ C1 A(IC1)  B(I) B(I)B(I)B(IC1)B(IC1) S1I,S2IC15C1AL5C2R C2  \ o BLOT ******xI1G1GC3C1&C4C20 A(C1) pÌ: A(C2) D A(C1) B(C1) N A(C2) XB(C2)B(C2)bT1,lT2C28vL5C1AC2T C3C4 nS(((G MAX 2)))T1S( ((G MAX 2)))T2GG G C3C4 \ G G1  ҍ G | S() S() C1C3C2C4 C1 C2 1 A(C1) IB(C1)B(C1)R S1_S2C1k L5C2t*C14 C3C4 >S(((G MAX 2)))S1HS( ((G MAX 2)))S2ƎR ؎\F1G1: FF1f p "I HIT YOU."zA(C1)H1H1 - "I HIT YOU."<A(C2)HH1H1R Xj "I CAN NOT MOVE."t   COMPUTER HOME ******G8 J G8G8B(J) Jя G8 `ڏG8 J $G8G8B(J). J8 G8 tBL5#LL6-V j6`L6m IC2 B(I) I2  IC3 B(I) I2  IC4 B(I) I2  II2I2͕ I2 ޕ C1 &C1C1H3& C2 : 0C2C2H3: C3 N'DC3C3H38N C4 bEXC4C4H3ob C1 C2 C3 C4 vylH3vI2 S(F3)I: T1S(F3) IC8 ˖ A(IC8) ᖨ A(IC8)  "I TOOK YOUR CHIP AT ";IC8H1H1%A(IC8)A(IC8);B(IC8)B(IC8)ST2IC8: S(F3)T2] sT2: S(F3)T2|C2B(I)B(I)  ė C1 C2 C3 C4 C7C8   C1 C2 C3 C4  *F3F34 >S1I: S(F3)S1&H IC7