home *** CD-ROM | disk | FTP | other *** search
/ PCDisk Magazine Disks / PCDisk Magazine - Disk 4.img / JIGJAGS.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-07-09  |  12.0 KB  |  205 lines

  1. 1  REM JIGJAGS Copyright (c) 1983 Ron Dubren & Assoc.
  2. 9  DEFFNUC%(LETTER%)=LETTER%+(32*(LETTER%>96)):KEYOFF:CLS:SCREEN0,0:FORI=1TO10:KEYI,"":NEXT:P$="1":DL=1:CL=2:COLOR2:AGAIN=0:Z$=CHR$(0):LOCATE,,0
  3. 10  WIDTH 80
  4. 20  DIMASCII(255),BD(15,29),PP$(16),SNGL$(16),DBL$(16),DI(15),BL(7,7),BP(7,7),PBRD(16,2),PBNK(16,2),PL(16,3,3),UNIQUE(9),PBS(7),PSOL(16,2),BNK(3,7),SCR$(22),LINES$(15),CLUE(16),BRDI(8,8),VIK(12),RANK$(11)
  5. 25  DATA"F1-MOVE TO GRID   F2-RETURN TO BANK   F3-MOVE WITHIN GRID   'SB'-SWITCH  H-HELP","PRESS ANY KEY TO CONTINUE","MOVE WOULD PUT PART OF PIECE OUTSIDE OF GRID","INVALID PLACEMENT OR PIECE CONFLICT
  6. 26  DATA"PIECE ALREADY PLACED","PLEASE STUDY PIECES FOR A MOMENT...YOU MAY BEGIN WHEN PIECE STARTS FLASHING","NO PIECE TO REMOVE","F1 MOVE NOT YET COMPLETE!","SORRY THAT'S NOT THE CORRECT SOLUTION...","NO PIECE TO MOVE","NO PIECE TO PLACE
  7. 27  DATA"PLEASE WAIT...FORMAT IN PROGRESS","CAN'T MOVE CLUE PIECE","NO ROOM FOR CLUE PIECE... REMOVE SOME PIECES AND TRY AGAIN","PRESS ANY KEY TO RETURN TO OPTIONS...":FORI=1TO15:READLINES$(I):NEXT
  8. 35  FORI=1TO255:ASCII(I)=I:NEXT:DATA217,188,192,200,218,201,191,187,193,202,195,204,180,185,194,203,197,206,179,186,196,205:FORI=1TO11:READS,D:ASCII(S)=D:NEXT
  9. 40  DATA72,80,75,77,59,32,67,84,81,83,79,72,72,80,75,77,59,60,61,83,80,68,13:FORI=1TO12:READVIK(I):NEXT:FORI=1TO7:READVIB(I):NEXT:FORI=1TO4:READVII(I):NEXT
  10. 55  DATA201,187,203,200,204,206,206,188,206,185,206,202,206,206,206:FORI=1TO15:READDI(I):NEXT
  11. 100  DATA2,37,"JIG JAGS",5,27,"The Jigsaw Crossword Puzzle",9,36,"created by",11,36,"Ron Dubren",15,35,"programmed by",17,32,"Infocenter Software",24,21,"Copyright 1983 Ron Dubren and Associates
  12. 156  FORI=1TO7:READR,C,D$:LOCATER,C:PRINTD$;:NEXT:DATA2,2,4,14,2,26,1,38,6,34,2,50,4,58,2,74,10,6,10,14,10,62,10,74,18,2,18,14,18,62,18,70:FORPC=1TO16:READPBNK(PC,1),PBNK(PC,2):NEXT
  13. 166  DATA1,2,3,4,6,7,8,9,10,0,5,0,11,12,13,14,0,0,0,15,16:FORI=1TO3:FORJ=1TO7:READBNK(I,J):NEXT:NEXT:CPN=1:BKR=1:BKC=1:BDR=1:BDC=1
  14. 175  DATA"                              HELP SCREEN","C - Clue Piece is Requested","T - Time elapsed in minutes","S - Save and Exit  (Game Saved)","O - Return to Options menu  (Game Not Saved)","Q - Quit and Go Home  (Game Not Saved)
  15. 176  DATA"[THESE KEYS ARE AVAILABLE ONLY WHILE CURSOR IS IN THE BANK]":FORI=1TO7:READHLP$(I):NEXT
  16. 180  DATA"GRAND MASTER","MASTER","CHAMP","PRO","SEMI-PRO","CHALLENGER","BEGINNER","NOVICE","APPRENTICE","AMATEUR","UNRANKED AMATEUR":FORI=1TO11:READRANK$(I):NEXT
  17. 240  FORI=1TO15:FORJ=1TO29:BD(I,J)=28:NEXT:NEXT:FORI=3TO13STEP2:FORJ=5TO25STEP4:BD(I,J)=197:NEXT:NEXT
  18. 250  DATA1,1,218,1,29,191,15,1,192,15,29,217:FORI=1TO4:READR,C,A:BD(R,C)=A:NEXT:FORI=1TO15STEP2:FORJ=2TO26STEP4:FORK=JTOJ+2:BD(I,K)=196:NEXT:NEXT:NEXT
  19. 280  FORI=2TO14STEP2:FORJ=1TO29STEP4:BD(I,J)=179:NEXT:NEXT:FORI=5TO25STEP4:BD(1,I)=194:BD(15,I)=193:NEXT:FORI=3TO13STEP2:BD(I,1)=195:BD(I,29)=180:NEXT
  20. 308  DATA1,2,3,4,5,8,9,13,14:OPEN "I",#1,"PIECES" :INPUT#1,SB$:INPUT#1,DB$:FORDAT=1TO9:READUNIQUE(DAT):INPUT#1,SNGL$(UNIQUE(DAT)):INPUT#1,PP$(UNIQUE(DAT)):NEXT:CLOSE:GOSUB12000
  21. 318  FORDAT=1TO9:PIECE=UNIQUE(DAT):LENGTH=LEN(SNGL$(PIECE)):PIECE$=SNGL$(PIECE):TMP$="":FORCHAR=1TOLENGTH:TMP$=TMP$+CHR$(ASCII(ASC(MID$(PIECE$,CHAR,1)))):NEXT:DBL$(PIECE)=TMP$:NEXT
  22. 328  DATA2,7,3,6,6,10,10,11,9,12,13,16,14,15:FORDAT=1TO7:READX,Y:SNGL$(Y)=SNGL$(X):DBL$(Y)=DBL$(X):PP$(Y)=PP$(X):NEXT
  23. 335  DATA"OPTIONS: ","","","     Press S to see a sample JIG JAGS puzzle","","","     Press E to exit","","","     Press [RETURN] to begin the game":FORI=1TO10:READSCR$(I):NEXT
  24. 350  CLS:COLOR2:LOCATE7,1:FORI=1TO10:PRINTSCR$(I):NEXT
  25. 400  X$=INKEY$:IFX$=""THEN400 ELSEXQ%=ASC(X$):X$=CHR$(FNUC%(XQ%))
  26. 405  IFLEN(X$)=1THENIC=ASC(X$):I=0ELSE400
  27. 410  IFX$<>CHR$(13)ANDX$<>"S"ANDX$<>"E"THEN400
  28. 415  IFX$="S"THEN500 ELSEIFX$="E"THEN12100
  29. 416  IFAGAIN=1THEN700
  30. 417  ONERRORGOTO430
  31. 420  OPEN "I",#1,"SAVED":CLS:LOCATE10,10:PRINT"RETURNING TO SAVED GAME...":GOTO3300
  32. 430  RESUME700
  33. 500  OP$=P$:P$=".smp":GOSUB7100:GOSUB7000:UL=0:GOSUB7200:X=FRE(""):LIN=15:GOSUB9000:FLG=0
  34. 505  FORPC=1TO16:GOSUB9100:GOSUB8200:CL=26:GOSUB8000:CL=2:R=PSOL(PC,1):C=PSOL(PC,2):GOSUB8200:CL=26:GOSUB8000:CL=2:BDR=R+1:BDC=C+2:GOSUB9500:GOSUB10100:GOSUB10200:GOSUB10700:GOSUB9100:CL=10:GOSUB8000:R=PSOL(PC,1):C=PSOL(PC,2):GOSUB8000:CL=2
  35. 510  IFINKEY$<>""THENPC=16:FLG=1
  36. 515  NEXT:COLOR2
  37. 520  IFFLG=0THENIFINKEY$=""THEN520
  38. 530  P$=OP$:GOTO350
  39. 700  CLS:COLOR14:PRINT"This is a list of the PUZZLE files currently on the disk":COLOR7:FILES"puzzle??":PRINT
  40. 720  LOCATE18,2:COLOR14:PRINT:PRINT"Please enter the NUMBER of the puzzle to play - ":INPUT"appearing immediately after the word 'PUZZLE'";P$:LOCATE22,1:PRINTSPACE$(79):ONERRORGOTO780:OPEN "PUZZLE"+P$ FOR INPUT AS 1:CLOSE1:GOTO800
  41. 780  BEEP:LOCATE22,1:PRINT"File Not Found - Try Again":RESUME720
  42. 800  COLORCL:CLS:LOCATE7,1:PRINT"WHAT DIFFICULTY LEVEL WOULD YOU LIKE?":LOCATE10:PRINTSPACE$(5);"1) HARD":PRINT:PRINT:PRINTSPACE$(5);"2) VERY HARD":PRINT:PRINT:INPUT"     CHOOSE ONE: ",D$:IFD$<>"1"ANDD$<>"2"THEN800 ELSEDL=VAL(D$):GOTO900
  43. 900  GOSUB7100:GOSUB7000:UL=0:GOSUB7200:IFDL=1THENGOSUB7400
  44. 910  X=FRE(""):LIN=1:GOSUB9000:TIME$="0":BKR=1:BKC=1
  45. 1010  PC=BNK(BKR,BKC):GOSUB9100:IN$=INKEY$:IFIN$<>""THENFORT=1TO50:NEXT:GOTO1100
  46. 1030  UL=1:IFPBRD(PC,1)=0THENCL=10:B$=SB$:GOSUB8000:CL=18:GOSUB8100:CL=2 ELSECL=26:B$=DB$:GOSUB8000:GOSUB9250:GOSUB8000:CL=2
  47. 1040  IN$=INKEY$:IFIN$=""THEN1040 ELSEGOSUB8300:GOTO1100
  48. 1100  I=0:IC=ASC(RIGHT$(IN$,1)):IFLEN(IN$)=1THEN1500
  49. 1110  I=I+1:IFI<=5THENIFIC=VIK(I)THEN1130 ELSE1110
  50. 1120  BEEP:GOTO1010
  51. 1130  ONIGOTO1140,1150,1160,1170,1300
  52. 1140  IFBKR>1THENBKR=BKR-1:GOTO1010ELSE1010
  53. 1150  IFBKR<3THENIFBNK(BKR+1,BKC)<>0THENBKR=BKR+1:GOTO1010ELSE1010ELSE1010
  54. 1160  IFPC=5THENBKR=1:BKC=3:GOTO1010
  55. 1165  IFBKC>1THENIFBNK(BKR,BKC-1)<>0THENBKC=BKC-1:GOTO1010ELSEBKC=BKC-4:GOTO1010ELSE1010
  56. 1170  IFPC=5THENBKR=1:BKC=5:GOTO1010
  57. 1175  IFBKC<7THENIFBNK(BKR,BKC+1)<>0THENBKC=BKC+1:GOTO1010ELSEBKC=BKC+4:GOTO1010ELSE1010
  58. 1200  IFPBRD(PC,1)=0THENPC=0
  59. 1201  GOSUB8400:GOSUB9600:GOTO2010
  60. 1300  IFPBRD(PC,1)<>0THENLIN=5:GOSUB9900:GOTO1010
  61. 1301  GOTO2010
  62. 1500  I=5
  63. 1510  I=I+1:IFI<13THENIFFNUC%(IC)=VIK(I)THEN1530 ELSE1510
  64. 1520  BEEP:GOTO1010
  65. 1530  ONI-5GOTO1200,1600,1700,12100,1900,1650,3200
  66. 1600  LOCATE24,1:COLOR14:PRINTSPACE$(9)+"A clue will cost you one skill level - Continue? (y/n) _"+SPACE$(14);:COLORCL
  67. 1602  XXX$=INKEY$:IFXXX$=""THEN1602 ELSEIFXXX$="n"ORXXX$="N"THENGOSUB9000:GOTO1010 ELSEIFXXX$="y"ORXXX$="Y"THENGOSUB9000:GOTO1605
  68. 1603  BEEP:GOTO1600
  69. 1605  FLG=0:BDR2=BDR:BDC2=BDC:PC2=PC:FORCLU=1TO16:IFPBRD(CLU,1)=0THENBDR=PSOL(CLU,1)+1:BDC=PSOL(CLU,2)+2:PC=CLU:GOSUB10000:IFER=0THENCLUE(PC)=1:CLU=16:FLG=1
  70. 1610  NEXT:IFFLG=1THENCLUES=CLUES+1:GOSUB9100:GOSUB8200:CL=26:GOSUB8000:CL=2:GOSUB9500:GOTO2630 ELSELIN=14:GOSUB9900:BDR=BDR2:BDC=BDC2:PC=PC2:GOTO1010
  71. 1650  AGAIN=1:GOTO350
  72. 1700  LOCATE24,1:COLOR2:PRINTSTRING$(79,32);:LOCATE24,1:COLOR0,7:PRINTUSING"TIME ELAPSED: ####.## MINUTES";VAL(TIME$)*60+VAL(MID$(TIME$,4,2))+VAL(RIGHT$(TIME$,2))/60;:GOSUB9800:LIN=1:GOSUB9000:GOTO1010
  73. 1900  CLOSE#1:OPEN "O",#1,"SAVED":PRINT#1,P$:FORI=1TO7:FORJ=1TO7:PRINT#1,BL(I,J):PRINT#1,BP(I,J):NEXT:NEXT:FORI=1TO8:FORJ=1TO8:PRINT#1,BRDI(I,J):NEXT:NEXT:FORI=1TO16:PRINT#1,PBRD(I,1):PRINT#1,PBRD(I,2):PRINT#1,CLUE(I):NEXT
  74. 1910  PRINT#1,CLUES:PRINT#1,TIME$:PRINT#1,DL:CLOSE#1:CLS:COLOR2,0:PRINT"PUZZLE SAVED":FORI=1TO1500:NEXTI:GOTO12100
  75. 2010  B$=DB$:IFPBRD(PC,1)<>0THENBDR=PBRD(PC,1)+1:BDC=PBRD(PC,2)+2 ELSEIFPC<>0THENGOSUB9100:GOSUB8200:CL=26:UL=1:GOSUB8000:CL=2:GOSUB8400:GOSUB9600
  76. 2020  B$=DB$:LOCATEBDR,BDC,1:IN$=INKEY$:IFIN$=""THENFORT=1TO50:NEXT:GOTO2020
  77. 2030  LOCATEBDR,BDC,1:I=0:IC=ASC(RIGHT$(IN$,1)):IFLEN(IN$)=1THEN2910
  78. 2040  I=I+1:IFI<=7THENIFIC=VIB(I)THEN2060 ELSE2040
  79. 2050  BEEP:GOTO2020
  80. 2060  IFI>4THEN2510
  81. 2080  ONIGOTO2090,2100,2110,2120
  82. 2090  IFBDR>10THENBDR=BDR-2:GOTO2125ELSE2125
  83. 2100  IFBDR<22THENBDR=BDR+2:GOTO2125ELSE2125
  84. 2110  IFBDC>29THENBDC=BDC-4:GOTO2125ELSE2125
  85. 2120  IFBDC<51THENBDC=BDC+4
  86. 2125  FORZ=1TO100:NEXT:IN$=INKEY$:IFIN$<>""THEN2030
  87. 2130  GOSUB9500:IFPC=BP(R,C)OR(PC<>0ANDPBRD(PC,1)=0)THEN2020
  88. 2135  IFPC<>BP(R,C)ANDPC=0THEN2150
  89. 2140  GOSUB9100:CL=10:GOSUB8000:GOSUB9250:GOSUB8000:CL=2
  90. 2150  GOSUB9500:PC=BP(R,C):IFPC=0THEN2020 ELSEGOSUB9100:CL=26:UL=1:GOSUB8000:GOSUB9250:CL=26:GOSUB8000:CL=2:GOTO2020
  91. 2510  ONI-4GOTO2610,2710,2810
  92. 2610  IFPBRD(PC,1)<>0THENLIN=5:GOSUB9900:GOTO2020
  93. 2615  IFPC=0THENLIN=11:GOSUB9900:GOTO2020
  94. 2620  GOSUB10000:IFER=1THENBEEP:GOSUB9000:GOSUB9800:LIN=1:GOSUB9000:GOTO2020
  95. 2630  BDR1=BDR:BDC1=BDC:GOSUB10100:R=PBRD(PC,1):C=PBRD(PC,2):GOSUB8200:CL=26:GOSUB8000:CL=2:GOSUB10200:BDR=BDR1:BDC=BDC1:GOSUB10700:GOSUB10500:GOTO2020
  96. 2710  IFPC=0THENLIN=7:GOSUB9900:GOTO2020
  97. 2715  GOSUB3100:IFER=1THEN2020
  98. 2720  IFPBRD(PC,1)=0THENLIN=8:GOSUB9900:GOTO2020
  99. 2730  BDR2=BDR:BDC2=BDC:GOSUB9250:CL=2:GOSUB8100:GOSUB10300:GOSUB9200:GOSUB9500:GOSUB10400:GOSUB9250:PBRD(PC,1)=0:PBRD(PC,2)=0:GOSUB9100:GOSUB8100:GOSUB8000:GOSUB10600:PC=0:BDR=BDR2:BDC=BDC2:GOTO2020
  100. 2810  IFPC=0THENLIN=7:GOSUB9900:GOTO2020
  101. 2815  GOSUB3100:IFER=1THEN2020
  102. 2820  IFPBRD(PC,1)=0THENLIN=10:GOSUB9900:GOTO2020
  103. 2830  BDR2=BDR:BDC2=BDC:GOSUB9250:CL=2:GOSUB8100:UL=1:GOSUB8000:GOSUB9100:B$=DB$:CL=10:UL=1:GOSUB8000:CL=2:GOSUB9200:BDR=BDR+1:BDC=BDC+2:GOSUB9500:GOSUB10400:LOCATEBDR,BDC,1
  104. 2840  LOCATEBDR,BDC,1:IN$=INKEY$:IFIN$=""THENFORI=1TO100:NEXT:GOTO2840
  105. 2850  I=0:IC=ASC(RIGHT$(IN$,1)):IFLEN(IN$)=1THEN2840
  106. 2855  IFIC=61THEN3010
  107. 2860  I=I+1:IFI<=4THENIFIC=VIB(I)THEN2880 ELSE2860
  108. 2870  GOTO2840
  109. 2880  ONIGOTO2890,2892,2894,2896
  110. 2890  IFBDR>10THENBDR=BDR-2:GOTO2840 ELSE2840
  111. 2892  IFBDR<22THENBDR=BDR+2:GOTO2840 ELSE2840
  112. 2894  IFBDC>29THENBDC=BDC-4:GOTO2840 ELSE2840
  113. 2896  IFBDC<51THENBDC=BDC+4:GOTO2840 ELSE2840
  114. 2910  IFIC<>32THEN2020 ELSEIFPBRD(PC,1)<>0THENCL=10:GOSUB9250:GOSUB8000:GOSUB9100:GOSUB8000:CL=2 ELSEIFPC<>0THENGOSUB9100:CL=2:GOSUB8100:GOSUB8000
  115. 2920  GOSUB8500:GOTO1010
  116. 3010  GOSUB10000:IFER=1THENGOSUB9900:GOTO2840
  117. 3020  GOSUB9250:COLOR2:GOSUB10300:R=BDR-1:C=BDC-2:PBRD(PC,1)=R:PBRD(PC,2)=C:GOSUB9500:GOSUB10100:CL=2:GOSUB9250:GOSUB8200:CL=26:GOSUB8000:GOSUB9100:GOSUB8000:CL=2:GOSUB10600:GOSUB9500:PC=BP(R,C):GOTO2020
  118. 3100  ER=0:IFCLUE(PC)=1THENLIN=13:GOSUB9900:ER=1
  119. 3120  RETURN
  120. 3200  CLS:COLOR13,0:LOCATE3,1:FORI=1TO7:PRINTSPACE$(5);HLP$(I):PRINT:PRINT:NEXT:LIN=2:GOSUB9000
  121. 3215  GOSUB7100:GOSUB7200:IFDL=1THENGOSUB7400
  122. 3220  CL=2:GOSUB10600:FORPC=1TO16:IFPBRD(PC,1)<>0THENGOSUB9100:CL=2:GOSUB8200:CL=10:GOSUB8000:GOSUB9250:GOSUB8000
  123. 3230  NEXT:CL=2:GOTO1010
  124. 3300  INPUT#1,P$:FORI=1TO7:FORJ=1TO7:INPUT#1,BL(I,J),BP(I,J):NEXT:NEXT:FORI=1TO8:FORJ=1TO8:INPUT#1,BRDI(I,J):NEXT:NEXT:FORI=1TO16:INPUT#1,PBRD(I,1),PBRD(I,2),CLUE(I):NEXT:INPUT#1,CLUES,FIN$,DL
  125. 3320  CLOSE:KILL"SAVED":GOSUB7012:TIME$=FIN$:GOSUB8500:GOTO3215
  126. 7000  CLUES=0:ERASEBL,BRDI,PBRD,BP,CLUE:DIMBL(7,7),BRDI(8,8),PBRD(16,2),BP(7,7),CLUE(16)
  127. 7012  OPEN "I",#2,"PUZZLE"+P$:INPUT#2,LETTERS$:FORI=1TO7:INPUT#2,PBS(I):NEXT:FORI=1TO16:INPUT#2,X:PSOL(I,1)=X+8:INPUT#2,Y:PSOL(I,2)=Y+25:NEXT:CLOSE
  128. 7015  LP=0:FORI=1TO16:FORJ=1TO3:FORK=1TO3:IFMID$(PP$(I),10-((J-1)*3+K),1)="0"THENPL(I,J,K)=0:GOTO7030
  129. 7025  LP=LP+1:X$=MID$(LETTERS$,LP,1):PL(I,J,K)=ASC(X$)
  130. 7030  NEXT:NEXT:NEXT:RETURN
  131. 7100  CLS:FORI=1TO15:LOCATE8+I,26:FORJ=1TO29:PRINTCHR$(BD(I,J));:NEXT:NEXT:RETURN
  132. 7200  OUL=UL:FORPC=1TO16:GOSUB9100:GOSUB8100:B$=SB$:UL=OUL:GOSUB8000:NEXT:RETURN
  133. 7400  FORI=1TO7:R=8+2*I:C=28+(PBS(I)-1)*4:LOCATER,1:PRINTSTRING$(C-1,28)+SB$;:BL(I,PBS(I))=42:NEXT:RETURN
  134. 8000  COLORCL:LOCATE,,0:C1=C:R1=R:IFPL(PC,1,1)=0THENC1=C1-4
  135. 8040  OB$=B$:R1=R1+1:C1=C1+2:FORI=1TO3:FORJ=1TO3:X$=CHR$(PL(PC,I,J)):IFX$=Z$THEN8060
  136. 8051  IFUL=1THENUL=2:IFX$<>"*"THENCOLORCL-1ELSEMID$(B$,13,1)="_
  137. 8052  IFX$="*"THENX$=B$:COLOR2
  138. 8054  LOCATER1,1:PRINTSTRING$(C1-1,28)+X$;:COLORCL:B$=OB$
  139. 8060  C1=C1+4:NEXT:R1=R1+2:C1=C1-12:NEXT:RETURN
  140. 8100  LOCATER,1,0:COLORCL:PRINTSTRING$(C-1,28)+SNGL$(PC);:B$=SB$:RETURN
  141. 8200  LOCATER,1,0:COLORCL:PRINTSTRING$(C-1,28)+DBL$(PC);:B$=DB$:RETURN
  142. 8300  IFPBRD(PC,1)=0THENCL=2:GOSUB8100:GOSUB8000 ELSEIFIN$<>" "THENGOSUB9100:CL=2:GOSUB8200:CL=10:GOSUB8000:GOSUB9250:GOSUB8000:CL=2
  143. 8320  RETURN
  144. 8400  FORX=1TO7:FORY=1TO7:IFBP(X,Y)=0THENR=X:C=Y:X=7:Y=7
  145. 8420  NEXT:NEXT:GOSUB9600:RETURN
  146. 8500  FORI=1TO3:FORJ=1TO7:PC=BNK(I,J):IF(PC<>0ANDPBRD(PC,1)=0)THENBKR=I:BKC=J:I=3:J=7
  147. 8520  NEXT:NEXT:RETURN
  148. 9000  LOCATE24,1:COLOR2:PRINTSTRING$(79,32);:LOCATE24,1:COLOR0,7:PRINTLINES$(LIN);:COLOR2,0:IFLIN<>2THENRETURN
  149. 9020  X$=INKEY$:IFX$=""THEN9020 ELSERETURN
  150. 9100  R=PBNK(PC,1):C=PBNK(PC,2):RETURN
  151. 9200  BDR=PBRD(PC,1):BDC=PBRD(PC,2):RETURN
  152. 9250  R=PBRD(PC,1):C=PBRD(PC,2):RETURN
  153. 9400  BDR=(K-1)*2+9:BDC=(L-1)*4+26:RETURN
  154. 9500  R=(BDR-10)/2+1:C=(BDC-28)/4+1:RETURN
  155. 9600  BDR=(R-1)*2+10:BDC=(C-1)*4+28:RETURN
  156. 9700  R1=R:C1=C:IFPL(PC,1,1)=0THENC1=C1-1
  157. 9720  RETURN
  158. 9800  FORZ=1TO4000:NEXT:RETURN
  159. 9900  GOSUB9000:BEEP:GOSUB9800:LIN=1:GOSUB9000:RETURN
  160. 10000  GOSUB9500:GOSUB9700:ER=0:FORI=1TO3:FORJ=1TO3:IFPL(PC,I,J)=0THEN10040
  161. 10020  IFR1<8ANDR1>0ANDC1<8ANDC1>0THENIFBL(R1,C1)=0AND((PL(PC,I,J)<>42ANDDL=1)ORDL=2)THEN10040 ELSEIFBL(R1,C1)=42ANDPL(PC,I,J)=42ANDDL=1THEN10040 ELSELIN=4:GOTO10030ELSELIN=3:GOTO10030
  162. 10030  ER=1:I=3:J=3
  163. 10040  C1=C1+1:NEXT:R1=R1+1:C1=C1-3:NEXT:RETURN
  164. 10100  GOSUB9700:PBRD(PC,1)=BDR-1:PBRD(PC,2)=BDC-2:FORI=1TO3:FORJ=1TO3:X$=CHR$(PL(PC,I,J)):IFX$=Z$THEN10130 ELSEBL(R1,C1)=ASC(X$):BP(R1,C1)=PC:V=1:FORK=R1TOR1+1:FORL=C1TOC1+1:BRDI(K,L)=BRDI(K,L)+V:V=V*2:NEXT:NEXT
  165. 10130  C1=C1+1:NEXT:R1=R1+1:C1=C1-3:NEXT:RETURN
  166. 10200  BDR1=BDR:BDC1=BDC:GOSUB9200:BDR=BDR+1:BDC=BDC+2:GOSUB9500:IFPL(PC,1,1)=0THENC=C-1
  167. 10203  COLOR2:LOCATE,,0:FORI=1TO3:FORJ=1TO3:IFPL(PC,I,J)=0THEN10230 ELSEFORK=RTOR+1:FORL=CTOC+1:GOSUB9400:LOCATEBDR,BDC:IFBRDI(K,L)=0THENPRINTCHR$(BD((K-1)*2+1,(L-1)*4+1));ELSEPRINTCHR$(DI(BRDI(K,L)));
  168. 10225  NEXT:NEXT
  169. 10230  C=C+1:NEXT:R=R+1:C=C-3:NEXT:BDR=BDR1:BDC=BDC1:RETURN
  170. 10300  C1=C:R1=R:IFPL(PC,1,1)=0THENC1=C1-4
  171. 10320  R1=R1+1:C1=C1+2:FORI=1TO3:FORJ=1TO3:X$=CHR$(PL(PC,I,J)):IFX$=Z$THEN10360
  172. 10340  IFDL=1THENIFX$="*"THENX$=SB$ ELSEX$=" 
  173. 10345  IFDL=2THENIFX$="*"THENX$=BB$ ELSEX$=" 
  174. 10350  LOCATER1,1:PRINTSTRING$(C1-1,28)+X$;
  175. 10360  C1=C1+4:NEXT:R1=R1+2:C1=C1-12:NEXT:RETURN
  176. 10400  GOSUB9700:FORI=1TO3:FORJ=1TO3:X$=CHR$(PL(PC,I,J)):IFX$=Z$THEN10420 ELSEIFX$="*"ANDDL=1THENBL(R1,C1)=42 ELSEBL(R1,C1)=0
  177. 10415  BP(R1,C1)=0:V=1:FORK=R1TOR1+1:FORL=C1TOC1+1:BRDI(K,L)=BRDI(K,L)-V:V=V*2:NEXT:NEXT
  178. 10420  C1=C1+1:NEXT:R1=R1+1:C1=C1-3:NEXT:RETURN
  179. 10500  FINISHED=1:FORI=1TO16:IFPBRD(I,1)=0THENFINISHED=0
  180. 10520  NEXT:IFFINISHED=0THEN10550
  181. 10530  WIN=1:FORI=1TO16:IFPBRD(I,1)<>PSOL(I,1)ORPBRD(I,2)<>PSOL(I,2)THENWIN=0
  182. 10540  NEXT:IFWIN=1THEN11000 ELSELIN=9:GOSUB9900
  183. 10550  RETURN
  184. 10600  LIN=12:GOSUB9000:COLOR2:IFDL<>1THEN10620 ELSEFORI=1TO7:IFBP(I,PBS(I))=0THENLOCATE8+2*I,1:PRINTSTRING$((28+(PBS(I)-1)*4)-1,28)+SB$;
  185. 10610  NEXT
  186. 10620  BDR1=BDR:BDC1=BDC:FORK=1TO8:FORL=1TO8:GOSUB9400:LOCATEBDR,BDC:IFBRDI(K,L)=0THENPRINTCHR$(BD((K-1)*2+1,(L-1)*4+1));ELSEPRINTCHR$(DI(BRDI(K,L)));
  187. 10630  NEXT:NEXT:FORR=1TO7:FORC=1TO7:GOSUB9600:IFBL(R,C)<>0ANDBL(R,C)<>42THENFORK=-1TO1:LOCATEBDR-1,BDC+K:PRINT"THEN";:LOCATEBDR+1,BDC+K:PRINT"THEN":NEXT:LOCATEBDR,BDC-2:PRINT"OPEN";:LOCATEBDR,BDC+2:PRINT"OPEN";
  188. 10650  NEXT:NEXT:GOSUB10700:BDR=BDR1:BDC=BDC1:LIN=1:GOSUB9000:RETURN
  189. 10700  FORR=1TO7:FORC=1TO7:IFBL(R,C)=42ANDBP(R,C)<>0THENLOCATE8+2*R,1:PRINTSTRING$((28+(C-1)*4)-1,28)+DB$;
  190. 10710  NEXT:NEXT:RETURN
  191. 11000  FIN$=TIME$:LOCATE24,1:PRINTSTRING$(79,32);:LOCATE24,1:BEEP:COLOR26:PRINT"CONGRATULATIONS!!!!!   THAT'S THE CORRECT SOLUTION!!!!";:GOSUB9800:LOCATE24,1:PRINTSTRING$(79,32);
  192. 11003  LOCATE24,1:COLOR0,7:PRINT"PRESS ANY KEY TO CLEAR SCREEN AND SEE YOUR RANK...";:COLOR2,0
  193. 11005  IFINKEY$=""THEN11005
  194. 11010  COLOR2:CLS:LOCATE5,1:FORI=1TO10:PRINTI,RANK$(I):NEXT:PRINT:PRINT" X",RANK$(11):TIME=VAL(FIN$)*60+VAL(MID$(FIN$,4,2))+VAL(RIGHT$(FIN$,2))/60:RANK=1+INT(TIME/15)+CLUES:RANK=RANK-(DL-1)*1:IFCLUES>0ANDDL=2THENRANK=RANK-1
  195. 11025  IFRANK<1THENRANK=1
  196. 11030  COLOR0,7:IFRANK>10THENLOCATE16,1:PRINT" X",RANK$(11) ELSELOCATE4+RANK:PRINTRANK,RANK$(RANK):COLOR2,0:LOCATE20,1
  197. 11999  COLOR2,0:LIN=2:GOSUB9000:AGAIN=1:GOTO350
  198. 12000  BB$=SB$:FORI=1TOLEN(BB$):A=ASC(MID$(BB$,I,1)):IFA=197THENX$=" 
  199. 12002  IFA=194ORA=193THENX$="SOUND
  200. 12003  IFA=195ORA=180THENX$="CALL
  201. 12004  IFA<100THENX$=CHR$(A)
  202. 12005  MID$(BB$,I,1)=X$:NEXT:RETURN
  203. 12100  KEY1,"LIST ":KEY2,"RUN"+CHR$(13):KEY3,"LOAD"+CHR$(34):KEY4,"SAVE"+CHR$(34):KEY5,"CONT"+CHR$(13):KEY6,","+CHR$(34)+"LPT1:"+CHR$(34)+CHR$(13):KEY7,"TRON"+CHR$(13):KEY8,"TROFF"+CHR$(13):KEY9,"KEY 
  204. 12110  KEY10,"SCREEN "+CHR$(0)+","+CHR$(0)+","+CHR$(0)+CHR$(13):CLS:PRINT"THANK YOU FOR PLAYING JIGJAGS":KEYON:END
  205.