home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / gam / jigsaw.ba < prev    next >
Text File  |  2006-10-19  |  6KB  |  105 lines

  1. 0 'JIGSAW.BA - BY JOE WASSERMAN
  2. 1 'CLUB 100 LIBRARY - 415/939-1246 BBS,    937-5039 NEWSLETTER, 932-8856 VOICE
  3. 2 CLS:PRINT@124,"Do You Want Instructions Y/N ";:S$=INPUT$(1):IFS$="Y"ORS$="y"THENGOSUB97
  4. 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
  5. 4 FORY=10TO74STEP8:PSET(Y,Z):NEXTY,Z:RESTORE70:FORZ=1TO12:GOSUB67:NEXT
  6. 5 PRINT@280,"Sel. Piece ";:P$=INPUT$(1):IFINSTR("ABCDEFGHIJKLMNO",P$)=0THEN5
  7. 6 IFP$="M"THENMENU
  8. 7 IFP$="N"THENGOSUB64:GOTO5
  9. 8 IFP$="O"THENGOSUB65:GOTO5
  10. 9 R1=ASC(P$)-65:R2=R1+1:IFMID$(A$,R2,1)=" "THENBEEP:GOTO5
  11. 10 PRINT@280,"Reverse Y/N ";:R$=INPUT$(1):IFR$<>"Y"THEN12
  12. 11 R(R1)=1*-(R(R1)=0):GOSUB59:ONR(R1)+1GOSUB33,46:GOSUB67
  13. 12 A=38:B=30:C=39:D=31
  14. 13 LINE(A,B)-(C,D),1,B
  15. 14 I$=INKEY$:IFI$=""THEN14
  16. 15 LINE(A,B)-(C,D),0,B:IFI$=CHR$(13)THEN25
  17. 16 ONASC(I$)-27GOSUB17,19,21,23:GOTO13:GOTO14
  18. 17 A=A+8:C=C+8:IFA>78THENA=6:C=7
  19. 18 RETURN
  20. 19 A=A-8:C=C-8:IFA<6THENA=78:C=79
  21. 20 RETURN
  22. 21 B=B-8:D=D-8:IFB<6THENB=6:D=7
  23. 22 RETURN
  24. 23 B=B+8:D=D+8:IFB>46THENB=6:D=7
  25. 24 RETURN
  26. 25 A1=INT(A/8):B1=INT(B/8):IFB(A1,B1)=1THEN28
  27. 26 R=R(R1):FORZ=0TO3:M=P(R,R1,Z,0):N=P(R,R1,Z,1)
  28. 27 IFB(M+A1,N+B1)=0THENNEXT:GOTO30
  29. 28 IFE>=11THENGOSUB65
  30. 29 PRINT@280,"Pc. Won't Fit";:FORZ=1TO1500:NEXT:PRINT@280,SPACE$(13);:GOTO5
  31. 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
  32. 31 READC,D:IFC=0ANDD=0THENLINE-(A,B):GOSUB59:E=E+1:IFE<12THEN5ELSEPRINT@100,"You Did It ! !":PRINT@140,"Congratulations":END
  33. 32 LINE-(A+C*8,B+D*8):GOTO31
  34. 33 ONR2GOSUB34,35,36,37,38,39,40,41,42,43,44,45:RETURN
  35. 34 RESTORE70:RETURN
  36. 35 RESTORE71:RETURN
  37. 36 RESTORE72:RETURN
  38. 37 RESTORE73:RETURN
  39. 38 RESTORE74:RETURN
  40. 39 RESTORE75:RETURN
  41. 40 RESTORE76:RETURN
  42. 41 RESTORE77:RETURN
  43. 42 RESTORE78:RETURN
  44. 43 RESTORE79:RETURN
  45. 44 RESTORE80:RETURN
  46. 45 RESTORE81:RETURN
  47. 46 ONR2GOSUB47,48,49,50,51,52,53,54,55,56,57,58:RETURN
  48. 47 RESTORE82:RETURN
  49. 48 RESTORE83:RETURN
  50. 49 RESTORE84:RETURN
  51. 50 RESTORE85:RETURN
  52. 51 RESTORE86:RETURN
  53. 52 RESTORE87:RETURN
  54. 53 RESTORE88:RETURN
  55. 54 RESTORE89:RETURN
  56. 55 RESTORE90:RETURN
  57. 56 RESTORE91:RETURN
  58. 57 RESTORE92:RETURN
  59. 58 RESTORE93:RETURN
  60. 59 RESTORE94:FORZ=65TO76:IFP$="F"THENLINE(226,2)-(234,42),0,BF:LINE(199,24)-(239,32),0,BF:RETURN
  61. 60 READA,B,C,D:IFASC(P$)=ZTHENLINE(A,B)-(C,D),0,BF:RETURN
  62. 61 NEXT
  63. 62 IFERL=16THENRESUMENEXT
  64. 63 IFERL=27THENPRINT@280,"Off the Board";:FORZ=1TO1500:NEXT:PRINT@280,SPACE$(13);:RESUME5ELSEPRINTERR;ERL:STOP
  65. 64 PRINT@280,"Sure?  Y/N ";:S$=INPUT$(1):IFS$="Y"THENRUN3ELSEPRINT@280,SPACE$(10);:RETURN
  66. 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
  67. 66 NEXTZ,Y:FORW=1TO2000*X:NEXTW:NEXTX:RETURN
  68. 67 READA,B:LINE(A,B)-(A,B)
  69. 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
  70. 69 LINE-(A+C*8,B+D*8):GOTO68
  71. 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
  72. 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
  73. 72 DATA141,10,2,0,2,-1,3,-1,3,2,2,2,2,1,0,1,0,0,25,67,145,13
  74. 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
  75. 74 DATA196,2,3,0,3,1,2,1,2,2,0,2,0,0,74,69,199,5
  76. 75 DATA226,2,1,0,1,5,0,5,0,0,118,70,229,5
  77. 76 DATA90,37,2,0,2,-1,4,-1,4,0,3,0,3,1,0,1,0,0,178,71,93,40
  78. 77 DATA126,37,1,0,1,2,3,2,3,3,0,3,0,0,223,72,129,40
  79. 78 DATA154,37,1,0,1,1,3,1,3,3,2,3,2,2,0,2,0,0,307,73,157,40
  80. 79 DATA89,47,1,0,1,1,4,1,4,2,0,2,0,0,298,74,92,50
  81. 80 DATA184,37,2,0,2,1,1,1,1,2,2,2,2,3,0,3,0,0,271,75,187,40
  82. 81 DATA206,53,1,0,1,-1,2,-1,2,0,4,0,4,1,0,1,0,0,276,76,209,56
  83. 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
  84. 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
  85. 84 DATA141,2,1,0,1,1,3,1,3,2,1,2,1,3,0,3,0,0,26,67,144,5
  86. 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
  87. 86 DATA196,2,3,0,3,2,1,2,1,1,0,1,0,0,75,69,199,5
  88. 87 DATA199,24,5,0,5,1,0,1,0,0,118,70,202,27
  89. 88 DATA87,29,2,0,2,1,4,1,4,2,1,2,1,1,0,1,0,0,176,71,90,32
  90. 89 DATA126,53,2,0,2,-2,3,-2,3,1,0,1,0,0,222,72,129,56
  91. 90 DATA154,45,2,0,2,-1,3,-1,3,1,1,1,1,2,0,2,0,0,308,73,157,48
  92. 91 DATA90,55,3,0,3,-1,4,-1,4,1,0,1,0,0,297,74,93,58
  93. 92 DATA183,37,2,0,2,3,0,3,0,2,1,2,1,1,0,1,0,0,232,75,186,40
  94. 93 DATA204,53,2,0,2,-1,3,-1,3,0,4,0,4,1,0,1,0,0,277,76,207,56
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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 ";
  101. 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:"
  102. 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 ";
  103. 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
  104. 103 PRINT@287,"Press any key to continue ";:S$=INPUT$(1):RETURN
  105.