home *** CD-ROM | disk | FTP | other *** search
/ PCDisk Magazine Disks / PCDisk Magazine - Disk 5.img / CHAM.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-05-28  |  12.4 KB  |  218 lines

  1. 5  TIME$="00:00:00":ON KEY(1)GOSUB 540:KEY(1)ON:COLOR 7,0:DIM BRD(8,8):DIM STRAT(8,8):DIM PATH1(32):DIM PATH2(32):PLAY"MB":CLS:KEY OFF:WIDTH 80:GOSUB 11000:LOCATE 12,25,0:PRINT"DO YOU WANT SOUND EFFECTS? (Y OR N)":TA=1200:TF=400:TH=1600:SND$=INPUT$(1)
  2. 10  REM *** CHAMELEON *** COPYRIGHT (C)  1982 BY CASEY ROCHE
  3. 160  IFSND$="Y"ORSND$="y"THENSND$="y" ELSESND$="n":TA=32000:TF=32000:TH=32000
  4. 170  CLS:IFSND$="y"THENPLAY"CD8E8CD8E8CD8E8F":SOUND3000,3
  5. 190  LOCATE11,22:PRINT"   -A GAME PROGRAM FROM CASEY ROCHE-":LOCATE12,25:PRINT"  *****************************":LOCATE13,27:PRINT"FOR THE IBM PERSONAL COMPUTER":LOCATE14,28:PRINT"    (C) Copyright 1982":LOCATE4,15:COLOR15,0
  6. 280  PRINT"CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLIN   CSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLIN     CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN":LOCATE5,15:PRINT"CSRLIN     CSRLIN   CSRLIN CSRLIN   CSRLIN CSRLIN CSRLIN CSRLIN CSRLIN     CSRLIN     CSRLIN     CSRLIN   CSRLIN CSRLINCSRLIN  CSRLIN":LOCATE6,15:PRINT"CSRLIN     CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLIN CSRLIN CSRLIN CSRLINCSRLINCSRLINCSRLIN  CSRLIN     CSRLINCSRLINCSRLINCSRLIN  CSRLIN   CSRLIN CSRLINCSRLIN  CSRLIN":LOCATE7,15
  7. 340  PRINT"CSRLIN     CSRLIN   CSRLIN CSRLIN   CSRLIN CSRLIN CSRLIN CSRLIN CSRLIN     CSRLIN     CSRLIN     CSRLIN   CSRLIN CSRLINCSRLIN  CSRLIN":LOCATE8,15:PRINT"CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLIN   CSRLIN CSRLIN   CSRLIN CSRLIN CSRLIN CSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLINCSRLINCSRLINCSRLIN CSRLINCSRLIN  CSRLIN":COLOR7,0:FORJF=1TO5:IFJF=1THENSH2=219:Z=14:Q=68:ST=2
  8. 400  IFJF=2THENSH2=178:Z=69:Q=13:ST=-2
  9. 410  IFJF=3THENSH2=177:Z=14:Q=68:ST=2
  10. 420  IFJF=4THENSH2=176:Z=69:Q=13:ST=-2
  11. 430  IFJF=5THENSH2=206:Z=14:Q=68:ST=1:COLOR15,0
  12. 440  FORIJ=ZTOQSTEPST:FORJI=4TO8:IFSCREEN(JI,IJ)<>32THENLOCATEJI,IJ:PRINTCHR$(SH2)
  13. 470  NEXT:NEXT:NEXT:FORI=1TO500:NEXT
  14. 510  COLOR7,0:GOTO580
  15. 540  COLOR 7,0:CLS:PRINT"Later.":FOR I%=1 TO 15:A$=INKEY$:NEXT I%:GOSUB 11500:END
  16. 580  CLS:LOCATE12,20:PRINT"TYPE C TO PLAY AGAINST THE COMPUTER OR
  17. 610  LOCATE13,23:PRINT"P TO PLAY AGAINST ANOTHER PERSON":PLR$=INPUT$(1):L$=CHR$(205):FORD=1TO8:FORL=1TO8:BRD(D,L)=0:STRAT(D,L)=0:NEXT:NEXT:Y$="LINELINELINE":M$="CSRLINCSRLINCSRLIN":BRD(4,4)=2:BRD(5,5)=2:BRD(4,5)=1:BRD(5,4)=1
  18. 780  IFPLR$="C"ORPLR$="c"THENCLR=1:PLR=0:GOSUB7060:GOTO840
  19. 790  IFPLR$="p"ORPLR$="P"THENPLR=2:CLR=0:GOSUB7140:GOTO1450
  20. 800  IFSND$="y"THENBEEP
  21. 810  LOCATE14,26:PRINT"YOU MUST TYPE P OR C ONLY":GOTO610
  22. 840  CLS:LOCATE12,23:PRINT"AT WHAT LEVEL WOULD YOU CARE TO PLAY?
  23. 870  LOCATE13,15:PRINT"TYPE B FOR BEGINNER, I FOR INTERMEDIATE OR E FOR EXPERT":LVL$=INPUT$(1):IFLVL$="b"ORLVL$="B"THENLVL=1:GOTO1450
  24. 910  IFLVL$="i"ORLVL$="I"THENLVL=2:GOTO1450
  25. 920  IFLVL$="e"ORLVL$="E"THENLVL=3:GOTO970
  26. 930  SOUNDTH,18:LOCATE14,28:PRINT"PLEASE TYPE ONLY B, I, OR E":GOTO870
  27. 970  FORI=1TO8:FORJ=1TO8:STRAT(I,J)=-64:NEXT:NEXT:FORI=3TO6:FORJ=3TO6:STRAT(I,J)=8:NEXT:NEXT:FORI=1TO8STEP7:FORJ=2TO7:STRAT(I,J)=128:NEXT:NEXT:FORI=2TO7:FORJ=1TO8STEP7:STRAT(I,J)=128:NEXT:NEXT:STRAT(1,1)=4096
  28. 1180  STRAT(1,8)=4096:STRAT(8,1)=4096:STRAT(8,8)=4096:STRAT(2,2)=-1024:STRAT(2,7)=-1024:STRAT(7,2)=-1024:STRAT(7,7)=-1024:STRAT(1,2)=-1024:STRAT(2,1)=-1024:STRAT(1,7)=-1024:STRAT(2,8)=-1024:STRAT(7,8)=-1024:STRAT(8,7)=-1024:STRAT(7,1)=-1024
  29. 1320  STRAT(8,2)=-1024:STRAT(1,3)=256:STRAT(1,6)=256:STRAT(3,1)=256:STRAT(3,3)=32:STRAT(3,6)=32:STRAT(3,8)=256:STRAT(6,1)=256:STRAT(6,3)=32:STRAT(6,6)=32:STRAT(6,8)=256:STRAT(8,3)=256:STRAT(8,6)=256
  30. 1450  CLS:PLAY"MF":LOCATE11,19:PRINT"I WILL NOW FLIP A COIN TO SEE WHO GOES FIRST":FORV=1TO12:LOCATE13,39:PRINT"CSRLINCSRLINCSRLIN":SOUNDTA,2:LOCATE13,39:PRINT"LINELINELINE":SOUNDTH,4:NEXT:DEFSEG=&H40:RANDOMIZEPEEK(&H6C):SOUNDTH,4
  31. 1590  FLIP=INT(2*RND+1):IFFLIP=2THEN1660
  32. 1610  LOCATE13,26:PRINT"LINELINELINE WON THE TOSS, "+IN1$+" GOES FIRST":FORV=1TO2500:NEXT:GOTO1700
  33. 1660  LOCATE13,23:PRINT"CSRLINCSRLINCSRLIN WON THE TOSS, "+IN2$+" WILL GO FIRST":FORV=1TO4500:NEXT
  34. 1700  IFLVL=2ORLVL=1THEN1720
  35. 1710  GOTO1780
  36. 1720  FORI=1TO8:FORJ=1TO8:STRAT(I,J)=1:NEXT:NEXT:GOTO1780
  37. 1780  COLOR15,0,0:CLS:COLOR0,15:LOCATE25,8:PRINT" use the cursor control keys to select a move, depress F1 to quit ":COLOR15,0:LOCATE24,1:PRINTSTRING$(80," "):LOCATE1,1:COLOR15,0:PRINT"           DEFSNGCHAMELEONDEFDBL
  38. 1890  PRINT"KEYTHENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHEN<0xCB!>THENTHENTHENCLOSE":PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN1":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE":PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN2":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE
  39. 1940  PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN3                    SCORE BOARD":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE                     KEYTHENTHENTHENTHEN<0xCB!>THENTHENTHENTHENCLOSE":PRINT"OPEN   OPEN   OPEN   OPENCSRLINCSRLINCSRLINOPENLINELINELINEOPEN   OPEN   OPEN   OPEN4                   <UNK! {0001}>OPEN 2  OPEN 2  OPEN<UNK! {0002}>
  40. 1970  PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE                     SCREENTHENTHENTHENTHENLOCATETHENTHENTHENTHENLOAD":PRINT"OPEN   OPEN   OPEN   OPENLINELINELINEOPENCSRLINCSRLINCSRLINOPEN   OPEN   OPEN   OPEN5                     LINELINELINE   CSRLINCSRLINCSRLIN":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE                      "+IN1$+"    "+IN2$
  41. 2000  PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN6":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE":PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN7":PRINT"TOTHENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENTAB(THENTHENTHENRANDOMIZE":PRINT"OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN   OPEN8":PRINT"SCREENTHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOCATETHENTHENTHENLOAD
  42. 2060  PRINT"  1   2   3   4   5   6   7   8":COLOR0,15:LOCATE20,2:PRINT"       C  O  L  U  M  N        ":FORL=3TO17:LOCATEL,37:PRINT" ":NEXT:LOCATE8,37:PRINT"R":LOCATE10,37:PRINT"O":LOCATE12,37:PRINT"W":COLOR7,0:FORL=3TO17:LOCATEL,38
  43. 2230  PRINTCHR$(221):NEXT:FORL=3TO17:LOCATEL,36:PRINTCHR$(222):NEXT:IFCLR=1GOTO2330
  44. 2300  LOCATE12,55:PRINT" "+IN1$+"   "+IN2$+" ":GOTO2350
  45. 2330  LOCATE12,55:PRINT" "+IN1$+"    "+IN2$
  46. 2350  YSCOR=2:LOCATE9,56:PRINTYSCOR:MSCOR=2:LOCATE9,61:PRINTMSCOR:LOCATE6,58:PRINTMID$(TIME$,1,5):IFLVL=1ANDCLR=1THEN2450
  47. 2440  GOTO2610
  48. 2450  X=1:Y=1:LOCATEX*2+1,Y*4-2:PRINT"LINELINELINE":SOUNDTF,6:BRD(X,Y)=1:YSCOR=YSCOR+1:X=8:Y=8:LOCATEX*2+1,Y*4-2:PRINT"LINELINELINE":SOUNDTF,6:BRD(X,Y)=1:YSCOR=YSCOR+1:LOCATE9,56:PRINTYSCOR
  49. 2610  COLOR15,0:LOCATE18,43:PRINT"ALL MOVES ARE DISPLAYED AS ROW,COLUMN":COLOR7,0:IFCLR=1GOTO2710
  50. 2660  LOCATE19,37:PRINT"PRESS ENTER FOR "+IN1$+"'S MOVE   -> CSRLINCSRLINCSRLINCSRLINCSRLIN   "+Y$:LOCATE20,37:PRINT"PRESS ENTER FOR "+IN2$+"'S MOVE   -> CSRLINCSRLINCSRLINCSRLINCSRLIN   "+M$:GOTO2750
  51. 2710  LOCATE19,43:PRINT"PRESS ENTER FOR MOVE   -> CSRLINCSRLINCSRLINCSRLINCSRLIN   "+Y$:LOCATE20,43:PRINT"THE COMPUTER'S MOVE IS -> CSRLINCSRLINCSRLINCSRLINCSRLIN   "+M$
  52. 2750  IFFLIP=2THEN2820
  53. 2760  X=4:Y=3:GOSUB6910:GOTO2870
  54. 2800  GOSUB6910:GOTO2870
  55. 2820  N=2:L=1:GOTO4530
  56. 2850  GOSUB6910:GOTO3680
  57. 2870  IFBRD(X,Y)<>0THENSOUNDTH,4:COLOR18,0:LOCATE21,68:PRINT"ILLEGAL MOVE":COLOR4,0:GOTO2890
  58. 2880  GOTO2940
  59. 2890  LOCATE21,3:PRINT"THAT SQUARE HAS SOMEONE IN IT ":FORTR=1TO6000:NEXT:GOTO2800
  60. 2940  LOCATE21,1:PRINTSTRING$(79," "):FLAG=0:COLOR15,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):COLOR15,0:FORF=1TO8:IFF=1THENA=-1:B=0
  61. 3030  IFF=2THENA=1:B=0
  62. 3040  IFF=3THENA=0:B=-1
  63. 3050  IFF=4THENA=0:B=1
  64. 3060  IFF=5THENA=1:B=1
  65. 3070  IFF=6THENA=-1:B=-1
  66. 3080  IFF=7THENA=-1:B=1
  67. 3090  IFF=8THENA=1:B=-1
  68. 3100  R=X+A:C=Y+B:CTR=0:IFR<1ORR>8ORC<1ORC>8THEN3320
  69. 3140  IFBRD(R,C)=0THEN3320
  70. 3150  IFBRD(R,C)=1THEN3320
  71. 3160  IFR<1ORR>8ORC<1ORC>8THEN3320
  72. 3170  IFBRD(R,C)=2THENCTR=CTR+1:R=R+A:C=C+B:GOTO3160
  73. 3180  IFBRD(R,C)=1ANDCTR>0THENFLAG=1:GOTO3190: ELSE3320
  74. 3190  FORI=1TOCTR:X=X+A:Y=Y+B:LOCATEX*2+1,Y*4-2:PRINT"LINELINELINE":SOUNDTF,1:SOUNDTA,1:BRD(X,Y)=1:YSCOR=YSCOR+1:MSCOR=MSCOR-1:NEXT:X=X+(CTR*(-1*A)):Y=Y+(CTR*(-1*B))
  75. 3320  CTR=0:R=X:C=Y:NEXT:LOCATE6,58:PRINTMID$(TIME$,1,5):IFFLAG=1THEN3390 ELSE3470
  76. 3390  LOCATEX*2+1,Y*4-2:PRINT"LINELINELINE":SOUNDTF,1:SOUNDTA,1:BRD(X,Y)=1:YSCOR=YSCOR+1:DEC=0:GOTO3600
  77. 3470  IFFLAG=0THEN3480 ELSE3600
  78. 3480  COLOR18,0:LOCATE21,68:PRINT"ILLEGAL MOVE":COLOR4,0:SOUNDTH,9:LOCATEX*2+1,Y*4-1:PRINT" ":LOCATE21,1:PRINT"     YOU MUST FLIP SOMETHING":FORTR=1TO6000:NEXT:GOTO2800
  79. 3600  LOCATE21,1:PRINTSTRING$(79," "):IF(YSCOR+MSCOR)>63ORYSCOR<1ORMSCOR<1GOTO5380
  80. 3630  LOCATE9,56:PRINTYSCOR:LOCATE9,61:PRINTMSCOR:GOTO2820
  81. 3680  IFBRD(X,Y)<>0THENSOUNDTH,9:COLOR18,0:LOCATE21,68:PRINT"ILLEGAL MOVE":COLOR4,0:GOTO3700
  82. 3690  GOTO3750
  83. 3700  LOCATE21,2:PRINT"THAT SQUARE HAS SOMEONE IN IT ":FORRT=1TO6000:NEXT:GOTO2850
  84. 3750  LOCATE21,1:PRINTSTRING$(79," ")
  85. 3770  FLAG=0:COLOR15,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):COLOR15,0:FORF=1TO8:IFF=1THENA=-1:B=0
  86. 3840  IFF=2THENA=1:B=0
  87. 3850  IFF=3THENA=0:B=-1
  88. 3860  IFF=4THENA=0:B=1
  89. 3870  IFF=5THENA=1:B=1
  90. 3880  IFF=6THENA=-1:B=-1
  91. 3890  IFF=7THENA=-1:B=1
  92. 3900  IFF=8THENA=1:B=-1
  93. 3910  R=X+A:C=Y+B:CTR=0:IFR<1ORR>8ORC<1ORC>8THEN4140
  94. 3950  IFBRD(R,C)=0THEN4140
  95. 3960  IFBRD(R,C)=2THEN4140
  96. 3970  IFR<1ORR>8ORC<1ORC>8THEN4140
  97. 3980  IFBRD(R,C)=1THENCTR=CTR+1:R=R+A:C=C+B:GOTO3970
  98. 3990  IFBRD(R,C)=2ANDCTR>0THEN4000: ELSE4140
  99. 4000  FORI=1TOCTR:X=X+A:Y=Y+B:LOCATEX*2+1,Y*4-2:PRINT"CSRLINCSRLINCSRLIN":SOUNDTA,1:SOUNDTF,1:BRD(X,Y)=2:YSCOR=YSCOR-1:MSCOR=MSCOR+1:FLAG=1:NEXT:X=X+(CTR*(-1*A)):Y=Y+(CTR*(-1*B))
  100. 4140  CTR=0:R=X:C=Y:NEXT:LOCATE6,58:PRINTMID$(TIME$,1,5):IFFLAG=1THEN4210 ELSE4320
  101. 4210  LOCATEX*2+1,Y*4-2:PRINT"CSRLINCSRLINCSRLIN":SOUNDTA,1:SOUNDTF,1:LOCATE21,1:PRINTSTRING$(79," "):BRD(X,Y)=2:MSCOR=MSCOR+1:FLAG=0:DEC=0:GOTO4400
  102. 4320  IFFLAG=0THENCOLOR18,0:LOCATE21,68:PRINT"ILLEGAL MOVE":COLOR4,0:SOUNDTH,9
  103. 4330  LOCATEX*2+1,Y*4-1:PRINT" ":LOCATE21,1:PRINT"     YOU MUST FLIP SOMETHING":FORTR=1TO6000:NEXT:GOTO2850
  104. 4400  LOCATE21,1:PRINTSTRING$(79," "):IF(YSCOR+MSCOR)>63ORYSCOR<1ORMSCOR<1GOTO5380
  105. 4430  LOCATE9,56:PRINTYSCOR:LOCATE9,61:PRINTMSCOR:IFBRD(1,1)=2THENSTRAT(1,2)=1024:STRAT(2,1)=1024:STRAT(2,2)=512
  106. 4480  IFBRD(1,8)=2THENSTRAT(1,7)=1024:STRAT(2,7)=512:STRAT(2,8)=1024
  107. 4490  IFBRD(8,1)=2THENSTRAT(7,1)=1024:STRAT(8,2)=1024:STRAT(7,2)=512
  108. 4500  IFBRD(8,8)=2THENSTRAT(7,8)=1024:STRAT(8,7)=1024:STRAT(7,7)=512
  109. 4510  N=1:L=2
  110. 4530  CHK=0:COLOR31,0:LOCATE21,1:PRINT"        DETERMINING MOVES":CNT=1:IFYSCOR+MSCOR>39THENGOSUB9000
  111. 4580  FORKD=1TO8:FORDK=1TO8:IFBRD(KD,DK)=LTHENGOSUB7270
  112. 4600  NEXT:NEXT
  113. 4610  COLOR15,0:FORG=1TOCNT-1:X=PATH1(G):Y=PATH2(G):R=X:C=Y:CTR=0:CHK=0:COLOR15,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(N):FORF=1TO8:IFF=1THENA=-1:B=0
  114. 4760  IFF=2THENA=1:B=0
  115. 4770  IFF=3THENA=0:B=-1
  116. 4780  IFF=4THENA=0:B=1
  117. 4790  IFF=5THENA=1:B=1
  118. 4800  IFF=6THENA=-1:B=-1
  119. 4810  IFF=7THENA=-1:B=1
  120. 4820  IFF=8THENA=1:B=-1
  121. 4830  R=R+A:C=C+B:CTR=0:IFR<1ORR>8ORC<1ORC>8THEN4920
  122. 4870  IFBRD(R,C)=0THEN4920
  123. 4880  IFBRD(R,C)=NTHEN4920
  124. 4890  IFR<1ORR>8ORC<1ORC>8THEN4920
  125. 4900  IFBRD(R,C)=LTHENR=R+A:C=C+B:CTR=CTR+1:GOTO4890
  126. 4910  IFBRD(R,C)=NANDCTR>0THENCHK=1:GOTO5020: ELSE4920
  127. 4920  CTR=0:R=X:C=Y:NEXT:LOCATEX*2+1,Y*4-1:PRINT" ":LOCATE6,58:PRINTMID$(TIME$,1,5):NEXT
  128. 5020  IFCHK=1ANDN=1THEN2800
  129. 5030  IFCHK=0ANDN=1THEN5260
  130. 5040  IFCHK=1ANDCLR=1ANDN=2THENRX=G:GOTO5620
  131. 5050  IFCHK=1ANDCLR=0ANDN=2THEN2850
  132. 5060  IFCHK=0ANDCLR=1ANDN=2THEN5170
  133. 5070  COLOR18,0:LOCATE21,69:PRINT"SORRY":COLOR4,0:LOCATE21,1:PRINT"     YOU HAVE NOTHING TO FLIP ":FORT=1TO6000:NEXT:SOUNDTH,9:GOTO5240
  134. 5170  SOUNDTA,18:COLOR18,0:LOCATE21,1:PRINT"    THE COMPUTER HAS NO MOVES":FORGI=1TO6000:NEXT:COLOR4,0
  135. 5240  DEC=DEC+1:IFDEC>1GOTO5380: ELSE4510
  136. 5260  COLOR31,0:LOCATE21,69:PRINT"SORRY":COLOR15,0:LOCATE21,1:PRINT"    YOU HAVE NOTHING TO FLIP    ":SOUNDTH,9:FORZ=1TO4000:NEXT:DEC=DEC+1:IFDEC>1THEN5380 ELSE2820
  137. 5370  GOTO4530
  138. 5380  LOCATE9,56:PRINTYSCOR:LOCATE9,61:PRINTMSCOR:IFSND$="y"THENFORI=1TO20:SOUNDRND*1000+37,1.5:NEXT
  139. 5430  IFYSCOR>MSCORANDCLR=1THENLOCATE14,51:PRINT"YOU WIN! NICE GAME "+IN1$:IFSND$="y"THENFORJ=1TO3:FORI=37TO2000STEP10:SOUNDI,0.1:NEXT:NEXT
  140. 5440  IFYSCOR<MSCORANDCLR=1THENLOCATE14,51:PRINT"I WIN! NICE GAME.":IFSND$="y"THENSOUND37,75
  141. 5450  IFYSCOR>MSCORANDPLR=2THENLOCATE14,51:PRINT"PLAYER "+IN1$+" WINS!
  142. 5460  IFMSCOR>YSCORANDPLR=2THENLOCATE14,51:PRINT"PLAYER "+IN2$+" WINS!
  143. 5470  IFYSCOR=MSCORANDCLR=1THENLOCATE14,51:PRINT"WE TIED! NICE GAME.
  144. 5480  IFYSCOR=MSCORANDPLR=2THENLOCATE14,51:PRINT"YOU TIED! NICE GAME.
  145. 5490  COLOR31,0,0:LOCATE15,51:PRINT"PLAY AGAIN (Y/N)?":COLOR15,0:AN$=INPUT$(1):IFAN$="Y"ORAN$="y"THEN5550 ELSE6400
  146. 5550  TIME$="00:00:00":FORI=1TO8:FORJ=1TO8:BRD(I,J)=0:NEXT:NEXT:GOTO6400
  147. 5620  XMAX=0:XMAX=0:YMAX=0:SMAX=0:MAX=-9999:FLAG=0:IFYSCOR+MSCOR=56THENFORKD=1TO8:FORDK=1TO8:STRAT(KD,DK)=1:NEXT:NEXT
  148. 5690  FORG=RXTOCNT-1:COLOR15,0:LOCATE21,1:PRINT"    CHECKING ROW"+STR$(PATH1(G))+", COLUMN"+STR$(PATH2(G)):CTR=0:FLAG=0:COLOR15,0:LOCATEPATH1(G)*2+1,PATH2(G)*4-1:PRINTCHR$(N):R=PATH1(G):C=PATH2(G):X=R:Y=C:FORF=1TO8:IFF=1THENA=-1:B=0
  149. 5830  IFF=2THENA=1:B=0
  150. 5840  IFF=3THENA=0:B=-1
  151. 5850  IFF=4THENA=0:B=1
  152. 5860  IFF=5THENA=1:B=1
  153. 5870  IFF=6THENA=-1:B=-1
  154. 5880  IFF=7THENA=-1:B=1
  155. 5890  IFF=8THENA=1:B=-1
  156. 5900  R=X+A:C=Y+B:CTR=0:IFR<1ORR>8ORC<1ORC>8THEN6050
  157. 5930  IFBRD(R,C)=0THEN6050
  158. 5940  IFBRD(R,C)=2THEN6050
  159. 5950  IFR<1ORR>8ORC<1ORC>8THEN6050
  160. 5960  IFBRD(R,C)=1THENCTR=CTR+1:R=R+A:C=C+B:GOTO5950
  161. 5970  IFBRD(R,C)=2ANDCTR>0THENFLAG=1:GOTO5980: ELSE6050
  162. 5980  FORI=1TOCTR:X=X+A:Y=Y+B:SMAX=SMAX+(STRAT(X,Y))+1:NEXT:X=X+(CTR*(-1*A)):Y=Y+(CTR*(-1*B)):R=X:C=Y:IFSND$="y"THENSOUND(RND*3000+37),1
  163. 6050  CTR=0:NEXT:LOCATEX*2+1,Y*4-1:PRINT" ":IFFLAG=1THENSMAX=SMAX+STRAT(X,Y)
  164. 6100  IFFLAG=1ANDSMAX=MAXTHENGOSUB6350
  165. 6110  IFFLAG=1ANDSMAX>MAXTHENMAX=SMAX:YMAX=Y:XMAX=X
  166. 6120  SMAX=0:FLAG=0:GOTO6180
  167. 6180  NEXT:X=XMAX:Y=YMAX:MAX=-9999:FLAG=0:COLOR15,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):MV$=RIGHT$(STR$(X),1)+","+RIGHT$(STR$(Y),1):COLOR0,15:LOCATE20,70:PRINTMV$:FORRU=1TO4:SOUNDTA,1:SOUNDTH,1:NEXT:GOTO3770
  168. 6350  DEFSEG=&H40:RANDOMIZEPEEK(&H6D)*256+PEEK(&H6C)-32768:FLIP=INT(2*RND+1):IFFLIP=1THENYMAX=Y:XMAX=X:MAX=SMAX
  169. 6390  RETURN
  170. 6400  OPEN "BEST" FOR INPUT AS #1:INPUT#1,TOPS,REC$:CLOSE#1:IFLVL=3THEN6440 ELSE6450
  171. 6440  IFTOPS<(YSCOR-MSCOR)ANDLVL=3THEN6570
  172. 6450  CLS:LOCATE10,10:PRINT"THE BEST EXPERT CHAMELEON PLAYER IS:":LOCATE12,10:PRINTREC$:FORI=1TO6000:NEXT:IFAN$="Y"ORAN$="y"THEN510
  173. 6530  COLOR7,0:CLS:PRINT"Later.":END
  174. 6570  CLS:COLOR31,0:LOCATE8,10:PRINT"C O N G R A T U L A T I O N S ! !":COLOR4,0:IFSND$="y"THENPLAY"C8E8G8C8E8G8C8E8G8G16G16G16G16G
  175. 6630  LOCATE10,5:PRINT"THROUGH LUCK, SKILL OR BOTH YOU HAVE BROKEN THE ":LOCATE11,5:PRINT"ALL-TIME RECORD AGAINST ME AT THE EXPERT LEVEL.":LOCATE12,5:PRINT"       THE PREVIOUS RECORD-HOLDER WAS:":LOCATE14,12:PRINTREC$:OPEN "BEST" FOR OUTPUT AS #1
  176. 6720  NUM=YSCOR-MSCOR:PRINT#1,NUM:LOCATE16,5:INPUT"WHAT'S YOUR NAME CHAMP";NAM$:LOCATE17,5:INPUT"WHAT IS THE DATE OF THIS SPLENDID OCCASION";DT$:PRINT#1,NAM$+" "+STR$(YSCOR)+" TO "+STR$(MSCOR)+" ON "+DT$:LOCATE19,5
  177. 6800  PRINT"THANK YOU, YOUR NAME WILL BE KEPT FOR POSTERITY.":CLOSE#1:FORJ=1TO2500:NEXT:IFAN$="Y"ORAN$="y"THEN510
  178. 6850  FORI=1TO2500:NEXT:COLOR7,0:CLS:PRINT"Later.":END
  179. 6910  COLOR31,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):LOCATE21,1:PRINTSTRING$(79," "):COLOR15,0:IFPLR=2ANDN=2THENLOCATE21,1:PRINT"        CSRLINCSRLINCSRLIN "+IN2$+"'S TURN....":GOTO6930
  180. 6920  LOCATE21,1:PRINT"        LINELINELINE "+IN1$+"'S TURN....
  181. 6930  COLOR0,15:IFPLR=2ANDN=2THENLOCATE20,70:PRINTMID$(STR$(X),2,1)+","+MID$(STR$(Y),2,1):GOTO6950
  182. 6940  LOCATE19,70:PRINTMID$(STR$(X),2,1)+","+MID$(STR$(Y),2,1)
  183. 6950  IFBRD(X,Y)=0THENCOLOR31,0:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):GOTO6965
  184. 6960  COLOR0,7:LOCATEX*2+1,Y*4-1:PRINTCHR$(15):COLOR15,0
  185. 6965  ONKEY(11)GOSUB6980:KEY(11)ON:ONKEY(12)GOSUB7000:KEY(12)ON:ONKEY(13)GOSUB7020:KEY(13)ON:ONKEY(14)GOSUB7040:KEY(14)ON
  186. 6970  AXN$=INKEY$:IFAXN$=CHR$(13)THENRETURN ELSE6970
  187. 6980  GOSUB10000:IFX=1THENBEEP:RETURN6930 ELSEIFBRD(X,Y)=1THENLOCATEX*2+1,Y*4-1:PRINT"LINE":GOTO6990 ELSEIFBRD(X,Y)=2THENLOCATEX*2+1,Y*4-1:PRINT"CSRLIN":GOTO6990 ELSELOCATEX*2+1,Y*4-1:PRINT" "
  188. 6990  X=X-1:RETURN6930
  189. 7000  GOSUB10000:IFY=1THENBEEP:RETURN6930 ELSEIFBRD(X,Y)=1THENLOCATEX*2+1,Y*4-1:PRINT"LINE":GOTO7010 ELSEIFBRD(X,Y)=2THENLOCATEX*2+1,Y*4-1:PRINT"CSRLIN":GOTO7010 ELSELOCATEX*2+1,Y*4-1:PRINT" "
  190. 7010  Y=Y-1:RETURN6930
  191. 7020  GOSUB10000:IFY=8THENBEEP:RETURN6930 ELSEIFBRD(X,Y)=1THENLOCATEX*2+1,Y*4-1:PRINT"LINE":GOTO7030 ELSEIFBRD(X,Y)=2THENLOCATEX*2+1,Y*4-1:PRINT"CSRLIN":GOTO7030 ELSELOCATEX*2+1,Y*4-1:PRINT" "
  192. 7030  Y=Y+1:RETURN6930
  193. 7040  GOSUB10000:IFX=8THENBEEP:RETURN6930 ELSEIFBRD(X,Y)=1THENLOCATEX*2+1,Y*4-1:PRINT"LINE":GOTO7050 ELSEIFBRD(X,Y)=2THENLOCATEX*2+1,Y*4-1:PRINT"CSRLIN":GOTO7050 ELSELOCATEX*2+1,Y*4-1:PRINT" "
  194. 7050  X=X+1:RETURN6930
  195. 7060  CLS:LOCATE12,20:PRINT"PLEASE TYPE IN YOUR INITIALS (3 LETTERS ONLY)":LOCATE13,20:INPUT"       THEN PRESS ENTER";IN1$:IN2$="PC ":IN1$=MID$(IN1$+"   ",1,3):RETURN
  196. 7140  CLS:LOCATE12,20:PRINT"PLAYER ONE (LINELINELINE) PLEASE TYPE IN YOUR":LOCATE13,20:INPUT"      INITIALS (3 LETTERS ONLY)";IN1$:IN1$=MID$(IN1$+"   ",1,3):CLS:LOCATE12,20:PRINT"PLAYER TWO (CSRLINCSRLINCSRLIN) PLEASE TYPE IN YOUR":LOCATE13,20
  197. 7240  INPUT"      INITIALS (3 LETTERS ONLY)";IN2$:IN2$=MID$(IN2$+"   ",1,3):RETURN
  198. 7270  FORF=1TO8:IFF=1THENA=-1:B=0
  199. 7290  IFF=2THENA=1:B=0
  200. 7300  IFF=3THENA=0:B=-1
  201. 7310  IFF=4THENA=0:B=1
  202. 7320  IFF=5THENA=1:B=1
  203. 7330  IFF=6THENA=-1:B=-1
  204. 7340  IFF=7THENA=-1:B=1
  205. 7350  IFF=8THENA=1:B=-1
  206. 7355  IFKD+A<1ORKD+A>8ORDK+B<1ORDK+B>8THEN7410
  207. 7360  IFBRD(KD+A,DK+B)<>0THEN7410 ELSEFLG=1
  208. 7370  FORCM=1TOCNT:IFPATH1(CM)=KD+AANDPATH2(CM)=DK+BTHENFLG2=2
  209. 7380  NEXT:IFFLG=1ANDFLG2=0THENPATH1(CNT)=KD+A:PATH2(CNT)=DK+B:CNT=CNT+1
  210. 7400  FLG=0:FLG2=0
  211. 7410  NEXT:RETURN
  212. 9000  CNT=1:FORKD=1TO8:FORDK=1TO8:IFBRD(KD,DK)=0THENPATH1(CNT)=KD:PATH2(CNT)=DK:CNT=CNT+1
  213. 9020  NEXT:NEXT:RETURN4610
  214. 10000  FORKX=2TO14:KEY(KX)OFF:NEXT:RETURN
  215. 11000  FOR I%=1 TO 10:KEY I%,"":NEXT I%:RETURN
  216. 11500  KEY 1,"LIST ":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13):KEY 6,","+CHR$(34)+"LPT1:"+CHR$(34)+CHR$(13):KEY 7,"TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9,"KEY "
  217. 11510  KEY 10,"SCREEN 0,0,0"+CHR$(13):KEY ON:ON ERROR GOTO 0:RETURN
  218.