0 'JIGSAW.BA - BY JOE WASSERMAN 1 'CLUB 100 LIBRARY - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE 2 CLS:PRINT@124,"Do You Want Instructions Y/N ";:S$=INPUT$(1):IFS$="Y"ORS$="y"THENGOSUB97 3 CLS:DEFINTA-Z:PRINT@122,"A Puzzle by Joe Wasserman ":ONERRORGOTO62:DIMB(9,5),P(1,11,3,1),R(11):A$="ABCDEFGHIJKL":RESTORE95:FORW=0TO1:FORZ=0TO11:FORY=0TO3:FORX=0TO1:READC:P(W,Z,Y,X)=C:NEXTX,Y,Z,W:CLS:LINE(2,2)-(82,50),1,B:FORZ=10TO42STEP8 4 FORY=10TO74STEP8:PSET(Y,Z):NEXTY,Z:RESTORE70:FORZ=1TO12:GOSUB67:NEXT 5 PRINT@280,"Sel. Piece ";:P$=INPUT$(1):IFINSTR("ABCDEFGHIJKLMNO",P$)=0THEN5 6 IFP$="M"THENMENU 7 IFP$="N"THENGOSUB64:GOTO5 8 IFP$="O"THENGOSUB65:GOTO5 9 R1=ASC(P$)-65:R2=R1+1:IFMID$(A$,R2,1)=" "THENBEEP:GOTO5 10 PRINT@280,"Reverse Y/N ";:R$=INPUT$(1):IFR$<>"Y"THEN12 11 R(R1)=1*-(R(R1)=0):GOSUB59:ONR(R1)+1GOSUB33,46:GOSUB67 12 A=38:B=30:C=39:D=31 13 LINE(A,B)-(C,D),1,B 14 I$=INKEY$:IFI$=""THEN14 15 LINE(A,B)-(C,D),0,B:IFI$=CHR$(13)THEN25 16 ONASC(I$)-27GOSUB17,19,21,23:GOTO13:GOTO14 17 A=A+8:C=C+8:IFA>78THENA=6:C=7 18 RETURN 19 A=A-8:C=C-8:IFA<6THENA=78:C=79 20 RETURN 21 B=B-8:D=D-8:IFB<6THENB=6:D=7 22 RETURN 23 B=B+8:D=D+8:IFB>46THENB=6:D=7 24 RETURN 25 A1=INT(A/8):B1=INT(B/8):IFB(A1,B1)=1THEN28 26 R=R(R1):FORZ=0TO3:M=P(R,R1,Z,0):N=P(R,R1,Z,1) 27 IFB(M+A1,N+B1)=0THENNEXT:GOTO30 28 IFE>=11THENGOSUB65 29 PRINT@280,"Pc. Won't Fit";:FORZ=1TO1500:NEXT:PRINT@280,SPACE$(13);:GOTO5 30 FORZ=0TO3:M=P(R,R1,Z,0):N=P(R,R1,Z,1):B(M+A1,N+B1)=1:NEXTZ:B(A1,B1)=1:MID$(A$,R2,1)=" ":ONR(R1)+1GOSUB33,46:A=A-4:B=B-4:LINE(A,B)-(A,B):READC,D 31 READC,D:IFC=0ANDD=0THENLINE-(A,B):GOSUB59:E=E+1:IFE<12THEN5ELSEPRINT@100,"You Did It ! !":PRINT@140,"Congratulations":END 32 LINE-(A+C*8,B+D*8):GOTO31 33 ONR2GOSUB34,35,36,37,38,39,40,41,42,43,44,45:RETURN 34 RESTORE70:RETURN 35 RESTORE71:RETURN 36 RESTORE72:RETURN 37 RESTORE73:RETURN 38 RESTORE74:RETURN 39 RESTORE75:RETURN 40 RESTORE76:RETURN 41 RESTORE77:RETURN 42 RESTORE78:RETURN 43 RESTORE79:RETURN 44 RESTORE80:RETURN 45 RESTORE81:RETURN 46 ONR2GOSUB47,48,49,50,51,52,53,54,55,56,57,58:RETURN 47 RESTORE82:RETURN 48 RESTORE83:RETURN 49 RESTORE84:RETURN 50 RESTORE85:RETURN 51 RESTORE86:RETURN 52 RESTORE87:RETURN 53 RESTORE88:RETURN 54 RESTORE89:RETURN 55 RESTORE90:RETURN 56 RESTORE91:RETURN 57 RESTORE92:RETURN 58 RESTORE93:RETURN 59 RESTORE94:FORZ=65TO76:IFP$="F"THENLINE(226,2)-(234,42),0,BF:LINE(199,24)-(239,32),0,BF:RETURN 60 READA,B,C,D:IFASC(P$)=ZTHENLINE(A,B)-(C,D),0,BF:RETURN 61 NEXT 62 IFERL=16THENRESUMENEXT 63 IFERL=27THENPRINT@280,"Off the Board";:FORZ=1TO1500:NEXT:PRINT@280,SPACE$(13);:RESUME5ELSEPRINTERR;ERL:STOP 64 PRINT@280,"Sure? Y/N ";:S$=INPUT$(1):IFS$="Y"THENRUN3ELSEPRINT@280,SPACE$(10);:RETURN 65 FORX=1TO0STEP-1:FORY=0TO5:FORZ=0TO9:M=Z*8+3:N=Y*8+3:IFB(Z,Y)=0THENLINE(M,N)-(M+6,N+6),X,BF 66 NEXTZ,Y:FORW=1TO2000*X:NEXTW:NEXTX:RETURN 67 READA,B:LINE(A,B)-(A,B) 68 READC,D:IFC=0ANDD=0THENLINE-(A,B):READC,D:PRINT@C,CHR$(D);:READC,D:LINE(C,D)-(C+1,D+1),1,B:RETURN 69 LINE-(A+C*8,B+D*8):GOTO68 70 DATA87,10,1,0,1,-1,2,-1,2,0,3,0,3,1,2,1,2,2,1,2,1,1,0,1,0,0,56,65,91,13 71 DATA114,2,2,0,2,1,3,1,3,3,2,3,2,2,1,2,1,1,0,1,0,0,102,66,118,5 72 DATA141,10,2,0,2,-1,3,-1,3,2,2,2,2,1,0,1,0,0,25,67,145,13 73 DATA168,10,1,0,1,-1,2,-1,2,1,3,1,3,2,1,2,1,1,0,1,0,0,71,68,172,13 74 DATA196,2,3,0,3,1,2,1,2,2,0,2,0,0,74,69,199,5 75 DATA226,2,1,0,1,5,0,5,0,0,118,70,229,5 76 DATA90,37,2,0,2,-1,4,-1,4,0,3,0,3,1,0,1,0,0,178,71,93,40 77 DATA126,37,1,0,1,2,3,2,3,3,0,3,0,0,223,72,129,40 78 DATA154,37,1,0,1,1,3,1,3,3,2,3,2,2,0,2,0,0,307,73,157,40 79 DATA89,47,1,0,1,1,4,1,4,2,0,2,0,0,298,74,92,50 80 DATA184,37,2,0,2,1,1,1,1,2,2,2,2,3,0,3,0,0,271,75,187,40 81 DATA206,53,1,0,1,-1,2,-1,2,0,4,0,4,1,0,1,0,0,276,76,209,56 82 DATA87,10,1,0,1,-1,2,-1,2,0,3,0,3,1,2,1,2,2,1,2,1,1,0,1,0,0,56,65,91,13 83 DATA114,10,1,0,1,-1,3,-1,3,0,2,0,2,1,1,1,1,2,0,2,0,0,102,66,118,13 84 DATA141,2,1,0,1,1,3,1,3,2,1,2,1,3,0,3,0,0,26,67,144,5 85 DATA168,18,1,0,1,-2,2,-2,2,-1,3,-1,3,0,2,0,2,1,0,1,0,0,68,68,171,21 86 DATA196,2,3,0,3,2,1,2,1,1,0,1,0,0,75,69,199,5 87 DATA199,24,5,0,5,1,0,1,0,0,118,70,202,27 88 DATA87,29,2,0,2,1,4,1,4,2,1,2,1,1,0,1,0,0,176,71,90,32 89 DATA126,53,2,0,2,-2,3,-2,3,1,0,1,0,0,222,72,129,56 90 DATA154,45,2,0,2,-1,3,-1,3,1,1,1,1,2,0,2,0,0,308,73,157,48 91 DATA90,55,3,0,3,-1,4,-1,4,1,0,1,0,0,297,74,93,58 92 DATA183,37,2,0,2,3,0,3,0,2,1,2,1,1,0,1,0,0,232,75,186,40 93 DATA204,53,2,0,2,-1,3,-1,3,0,4,0,4,1,0,1,0,0,277,76,207,56 94 DATA87,2,111,26,114,2,139,26,141,0,166,26,168,2,193,26,196,2,220,18,0,0,0,0:DATA87,29,122,45,126,37,150,62,154,37,178,62,89,47,122,63,183,37,200,61,204,45,239,61 95 DATA1,-1,1,0,2,0,1,1,1,0,1,1,2,1,2,2,1,0,2,0,2,-1,2,1,1,-1,1,0,1,1,2,1,1,0,2,0,0,1,1,1,0,1,0,2,0,3,0,4:DATA1,0,2,0,2,-1,3,-1,0,1,0,2,1,2,2,2,0,1,1,1,2,1,2,2,0,1,1,1,2,1,3,1,1,0,0,1,0,2,1,2,1,0,1,-1,2,0,3,0 96 DATA1,-1,1,0,2,0,1,1,0,1,1,0,1,-1,2,-1,0,1,0,2,1,1,2,1,1,0,1,-1,1,-2,2,-1,1,0,2,0,1,1,2,1,1,0,2,0,3,0,4,0:DATA1,0,1,1,2,1,3,1,1,0,2,0,2,-1,2,-2,0,1,1,0,2,0,2,-1,1,0,2,0,3,0,3,-1,1,0,1,1,1,2,0,2,1,0,2,0,2,-1,3,0 97 CLS:PRINT"Use Upper Case ONLY":PRINT:PRINT"Object is to fit the 12 pieces into the rectangle with no space left unused.":PRINT"Piece to be played is selected by its letter (A to L)":GOSUB103 98 CLS:PRINT"Each piece has a small square used for locating on the playing area.";:PRINT" Pieces can be reversed when prompted except for A (no change) and F (90 degree rotation). ":GOSUB103 99 CLS:PRINT"After selection a square will appear on the board which is moved by using the 4 arrow keys. ";:PRINT"After selecting a location on the board, the piece is placed with its square "; 100 PRINT"in the same location as the board square by pressing ENTER.":GOSUB103:CLS:PRINT"Pieces cannot be placed where they won't fit or outside of the border.":PRINT"The following can also be be used at the'Sel. Piece' prompt:" 101 PRINT" M end game-return to MENU":PRINT" N start NEW game":PRINT" O review spaces still OPEN":GOSUB103:CLS:PRINT"Once placed, a piece cannot be moved. If a piece is selected and not placed it can be changed "; 102 PRINT"by placing it in a posi- tion it won't fit. You can then select another piece or rotate the curent piece":PRINT@287,"Press any key to start ";:S$=INPUT$(1):RETURN 103 PRINT@287,"Press any key to continue ";:S$=INPUT$(1):RETURN