home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / text / crypshak.zip / SKIP10.BAS < prev    next >
BASIC Source File  |  1993-07-22  |  19KB  |  334 lines

  1. 10 KEY OFF:SCREEN 0:COLOR 14,1:CLS:COLOR 14,1
  2. 20 PRINT:PRINT:COLOR 14,0:PRINT SPC(21);">>>     This is SKIP10.EXE    <<<";SPC(26);:COLOR 0,7:PRINT
  3. 30 LOCATE 25,3:PRINT" More info: hit M";SPC(13);:COLOR 31,4:PRINT" *    *    * ";:COLOR 0,7:PRINT SPC(19);"By Penn Leary ":LOCATE 2,1:COLOR 14,1
  4. 40 PRINT:PRINT:PRINT SPC(5);"This program will print Bacon's +4 Caesar plaintext for the ciphertext."
  5. 50 PRINT" Nomenclature: The Ciphertext is the problem to be attacked, usually the"
  6. 60 PRINT" letters/words in a facsimile edition of Shakespeare's poems or plays.  The"
  7. 70 PRINT" Plaintext is the readout of the possible solution of the ciphertext."
  8. 80 PRINT:PRINT SPC(5);"A 21 letter Elizabethan alphabet is used (see below); therefore"
  9. 90 PRINT" characters X, Z, space and all others will be rejected; the letter I will"
  10. 100 PRINT" be substituted for J, and the letter V for U and W. Enter them in either"
  11. 110 PRINT" upper or lower case.  Ciphertext letters may be selected to be skipped" 
  12. 120 PRINT" from 2 to 10. These may be repeated or reversed.":PRINT
  13. 130 COLOR 11,1:PRINT SPC(5);"Bacon's alphabet is   A B C D E F G H I K L M N O P Q R S T V Y"
  14. 140 PRINT SPC(5);"The +4 ciphertext is  E F G H I K L M N O P Q R S T V Y A B C D":COLOR 14,1:PRINT
  15. 150 PRINT SPC(5);"The ciphertext may have no more than 1000 characters.  If you exceed"
  16. 160 PRINT" that, the program will terminate and begin the readout. You may also make"
  17. 170 PRINT" or read a disk file.  Backspace will erase; end entry by pressing Enter."
  18. 180 PRINT" Only the compiled .EXE program will read or write more than 255 letters."
  19. 190 PRINT" If you enter more than 252 letters, a diskfile called MYFILE will be created."
  20. 200 PRINT:COLOR 14,1:LOCATE,,1
  21. 210 COLOR 14,0:PRINT SPC(22);">>>    To begin, hit a key    <<<";SPC(25);:COLOR 14,1:W$=INPUT$(1):CLS
  22. 220 IF W$="M" OR W$="m" THEN GOSUB 2360
  23. 230 DIM M(1024),T(255)
  24. 240 DEFINT A-I,K-L,O-Z
  25. 250 M(J%)=0:N=0
  26. 260 CLOSE:PRINT
  27. 270 COLOR 27,1:PRINT" .   .   .   .   .   .   .   .   .  ";:COLOR 10,4:PRINT"To read a disk file, enter";:COLOR 30,0:PRINT" D:":COLOR 14,1:PRINT
  28. 280 COLOR 10,4:PRINT"Or, to enter letters WITH OPTION TO MAKE A DISK FILE, hit";:COLOR 30,0:LINE INPUT" Return:";Z$:COLOR 14,1
  29. 290 IF Z$="D" OR Z$="d" THEN PRINT:GOTO 2170
  30. 300 CLS:COLOR 11,1:PRINT"Number of letters entered are:":COLOR 14,1
  31. 310 LOCATE 2,1:COLOR 11,1:PRINT"Enter ciphertext:";SPC(32);"(Hit Escape to abort)":COLOR 14,1
  32. 320 LOCATE 3,1:PRINT CHR$(26):LOCATE 3,2
  33. 330 FOR J%=1 TO 1000
  34. 340 X$=INKEY$:IF X$="" THEN 340
  35. 350 IF ASC(X$)=8 AND N<>0 AND POS(X)=1 THEN LOCATE CSRLIN-1:LOCATE,80:PRINT" ";:LOCATE CSRLIN-1:LOCATE,80:N=N-1:J%=J%-1:GOTO 340
  36. 360 IF ASC(X$)=8 AND N<>0 THEN H=POS(1):LOCATE CSRLIN,H-1:PRINT" ";:LOCATE CSRLIN,H-1:N=N-1:J%=J%-1:GOTO 340
  37. 370 BB=INT(J%/80)
  38. 380 COLOR 15,4:LOCATE 1,31:PRINT J%:LOCATE BB+3,J%-(BB*80)+1:COLOR 14,1
  39. 390 IF ASC(X$)=27 THEN CLS:PRINT:GOTO 1780
  40. 400 IF ASC(X$)=13 THEN COLOR 14,1:GOTO 520
  41. 410 IF ASC(X$)<65 THEN BEEP:GOTO 340
  42. 420 IF ASC(X$)>90 AND ASC(X$)<97 THEN BEEP:GOTO 340
  43. 430 IF ASC(X$)>96 AND ASC(X$)<123 THEN X$=CHR$(ASC(X$)-32)
  44. 440 IF ASC(X$)>122 THEN BEEP:GOTO 340
  45. 450 IF ASC(X$)=90 OR ASC(X$)=88 THEN BEEP:GOTO 340
  46. 460 IF ASC(X$)=74 THEN X$="I":GOTO 490
  47. 470 IF ASC(X$)=85 THEN X$="V":GOTO 490
  48. 480 IF ASC(X$)=87 THEN X$="V"
  49. 490 PRINT X$;:M(J%)=ASC(X$):N=N+1
  50. 500 IF J%=1000 THEN BEEP:PRINT:INPUT"Limit of 1000 characters has been reached -- hit RETURN.";W$:IF W$="" THEN PRINT:PRINT:GOTO 510
  51. 510 NEXT J%
  52. 520 J%=0:M(J%)=0:E$="":Y$=""
  53. 530 IF N > 252 THEN Y$="M":R$="MYFILE":PRINT
  54. 540 IF N < 253 THEN COLOR 14,0:PRINT:PRINT:PRINT"To make a disk file enter M ":PRINT
  55. 550 IF N < 253 THEN INPUT"Otherwise hit return      ";Y$:COLOR 14,1:PRINT
  56. 560 IF Y$="M" OR Y$="m" THEN GOTO 580 ELSE GOTO 640
  57. 570 IF N < 253 THEN GOTO 640
  58. 580 IF N < 253 THEN COLOR 11,1:CLS:PRINT:PRINT"Files on disk are (Limit for compiled program--about 8000 characters):"
  59. 590 IF N < 253 THEN FILES"????????"
  60. 600 IF N < 253 THEN PRINT SPC(13);"Enter a name for the new disk file"
  61. 610 IF N < 253 THEN PRINT SPC(12);"(maximum of 8 letters, no extension)":PRINT
  62. 620 IF N < 253 THEN INPUT"CAUTION: If the name you enter exists, it will be ERASED and written over          ";R$:COLOR 14,1:CLS:PRINT
  63. 630 IF N < 253 AND R$="" THEN PRINT:PRINT"You must enter a name.":GOTO 540
  64. 640 IF N < 253 THEN COLOR 10,4:PRINT"To reverse ciphertext hit";:COLOR 30,0:PRINT" D ";:COLOR 10,4:PRINT"otherwise hit a key for each series.":COLOR 14,1:V$=INPUT$(1):CLS:PRINT
  65. 650 IF V$="D" OR V$="d" THEN GOSUB 1980:COLOR 14,1
  66. 660 IF Y$="M" OR Y$="m" THEN COLOR 14,1:CLS:PRINT "Diskfile ";R$;" has been created.";:COLOR 10,1
  67. 670 LOCATE 25,29:COLOR 9,0:PRINT " Hit X to exit":COLOR 14,1:CLS 2:COLOR 14,1:LOCATE 2,1
  68. 680 IF V$="D" OR V$="d" THEN LOCATE 25,17:COLOR 9,0:PRINT " Hit X to exit, ciphertext is reversed.":COLOR 14,1:CLS 2:COLOR 14,1:LOCATE 2,1
  69. 690 IF N < 253 AND V$="D" OR V$="d" THEN COLOR 11,1:PRINT "Ciphertext reversed is:":COLOR 14,1:ELSE IF N<253 THEN COLOR 11,1:PRINT"Ciphertext is:":COLOR 14,1
  70. 700 FOR J%=1 TO N:IF N < 253 THEN PRINT CHR$(M(J%));" ";
  71. 710 E$=E$+CHR$(M(J%))
  72. 720 NEXT J%
  73. 730 COLOR 14,6:IF N > 1 AND N < 253 THEN PRINT N;"Letters entered.":COLOR 14,1
  74. 740 IF N > 252 THEN GOSUB 2130:COLOR 14,1:PRINT "Diskfile ";R$;" has been created":COLOR 14,1:GOTO 2230
  75. 750 IF Y$="M" OR Y$="m" THEN GOSUB 2130:GOTO 760
  76. 760 COLOR 14,1
  77. 770 K=0:IF LEN(E$) > 320 THEN COLOR 14,6:PRINT"To set lower printout speed enter a number from 1 to 20, otherwise hit return. ":INPUT K:COLOR 14,1
  78. 780 COLOR 11,1:PRINT"Plaintext, +4 is:":COLOR 14,1
  79. 790 B$="ABCDEFGHIKLMNOPQRSTVY"
  80. 800 C$="EFGHIKLMNOPQRSTVYABCD"
  81. 810 FOR Q=1 TO LEN(E$):FOR JJ=1 TO (K*20):NEXT JJ
  82. 820 X=INSTR(B$,MID$(E$,Q,1))
  83. 830 IF X>0 THEN MID$(E$,Q,1)=MID$(C$,X,1)
  84. 840 T$=E$:GOSUB 3230
  85. 850 PRINT" ";
  86. 860 NEXT Q
  87. 870 COLOR 0,7
  88. 880 PRINT:PRINT "To read from 2 to 10 skips, enter C, or hit a key.":S$=INPUT$(1)
  89. 890 IF S$="C" OR S$="c" THEN BB=1:GOTO 900 ELSE IF S$="X" OR S$="x" THEN GOTO 1780 ELSE GOTO 910
  90. 900 BB=BB+1:GOTO 970
  91. 910 LOCATE CSRLIN-1:PRINT SPC(80);:LOCATE CSRLIN
  92. 920 IF BB>1 THEN COLOR 14,6:PRINT "Last skip is ";AA$;
  93. 930 COLOR 15,0
  94. 940 INPUT " Enter a number from 2 to 10 to select skip or 1 to exit";BB:COLOR 14,1
  95. 950 IF BB=1 THEN GOTO 1780
  96. 960 IF BB <2 OR BB >10 THEN BEEP:PRINT"Error...";:GOTO 920
  97. 970 IF BB=2 THEN AA$="Second"
  98. 980 IF BB=3 THEN AA$="Third"
  99. 990 IF BB=4 THEN AA$="Fourth"
  100. 1000 IF BB=5 THEN AA$="Fifth"
  101. 1010 IF BB=6 THEN AA$="Sixth"
  102. 1020 IF BB=7 THEN AA$="Seventh"
  103. 1030 IF BB=8 THEN AA$="Eighth"
  104. 1040 IF BB=9 THEN AA$="Ninth"
  105. 1050 IF BB=10 THEN AA$="Tenth"
  106. 1060 LOCATE CSRLIN-1:COLOR 14,1:PRINT SPC(79);:LOCATE CSRLIN-1
  107. 1070 COLOR 7,1:PRINT AA$;" (1):":COLOR 14,1
  108. 1080 COLOR 14,1
  109. 1090 FOR Q=1 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  110. 1100 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  111. 1110 NEXT Q
  112. 1120 PRINT
  113. 1130 COLOR 11,1
  114. 1140 COLOR 11,1:W$=INPUT$(1):GOSUB 3240
  115. 1150 COLOR 7,1:PRINT AA$;" (2):":COLOR 14,1
  116. 1160 COLOR 14,1
  117. 1170 FOR Q=2 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  118. 1180 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  119. 1190 NEXT Q
  120. 1200 PRINT
  121. 1210 COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=2 THEN PRINT:GOTO 1760
  122. 1220 COLOR 7,1:PRINT AA$;" (3):":COLOR 14,1
  123. 1230 COLOR 14,1
  124. 1240 FOR Q=3 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  125. 1250 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  126. 1260 NEXT Q
  127. 1270 PRINT
  128. 1280 COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=3 THEN PRINT:GOTO 1760
  129. 1290 COLOR 7,1:PRINT AA$;" (4):":COLOR 14,1
  130. 1300 COLOR 14,1
  131. 1310 FOR Q=4 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  132. 1320 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  133. 1330 NEXT Q
  134. 1340 PRINT:COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=4 THEN PRINT:GOTO 1760
  135. 1350 COLOR 7,1:PRINT AA$;" (5):":COLOR 14,1
  136. 1360 COLOR 14,1
  137. 1370 FOR Q=5 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  138. 1380 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  139. 1390 NEXT Q
  140. 1400 PRINT:COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=5 THEN PRINT:GOTO 1760
  141. 1410 COLOR 7,1:PRINT AA$;" (6):":COLOR 14,1
  142. 1420 COLOR 14,1
  143. 1430 FOR Q=6 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  144. 1440 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  145. 1450 NEXT Q
  146. 1460 PRINT
  147. 1470 COLOR 11,1
  148. 1480 COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=6 THEN PRINT:GOTO 1760
  149. 1490 COLOR 7,1:PRINT AA$;" (7):":COLOR 14,1
  150. 1500 COLOR 14,1
  151. 1510 FOR Q=7 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  152. 1520 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  153. 1530 NEXT Q
  154. 1540 PRINT
  155. 1550 COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=7 THEN PRINT:GOTO 1760
  156. 1560 COLOR 7,1:PRINT AA$;" (8):":COLOR 14,1
  157. 1570 COLOR 14,1
  158. 1580 FOR Q=8 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  159. 1590 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  160. 1600 NEXT Q
  161. 1610 PRINT
  162. 1620 COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=8 THEN PRINT:GOTO 1760
  163. 1630 COLOR 7,1:PRINT AA$;" (9):":COLOR 14,1
  164. 1640 COLOR 14,1
  165. 1650 FOR Q=9 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  166. 1660 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  167. 1670 NEXT Q
  168. 1680 PRINT:COLOR 11,1:W$=INPUT$(1):GOSUB 3240:IF BB=9 THEN PRINT:GOTO 1760
  169. 1690 COLOR 7,1:PRINT AA$;" (10):":COLOR 14,1
  170. 1700 COLOR 14,1
  171. 1710 FOR Q=10 TO LEN(E$) STEP BB:FOR JJ=1 TO (K*20):NEXT JJ
  172. 1720 T=ASC(MID$(E$,Q,1)):GOSUB 3220
  173. 1730 NEXT Q
  174. 1740 IF V$="D" OR V$="d" OR P$="D" OR P$="d" THEN COLOR 11,1:PRINT"(Ciphertext was reversed.)"
  175. 1750 W$=INPUT$(1):PRINT
  176. 1760 IF BB=10 THEN GOTO 1780 ELSE IF S$="C" OR S$="c" THEN GOTO 900
  177. 1770 W$="":IF Z$="d" THEN Z$="D":IF V$="d" THEN V$="D":IF P$="d" THEN P$="D":IF Y$="m" THEN Y$="M"
  178. 1780 Y$="":COLOR 14,0:PRINT:PRINT "If you made (or read) a diskfile and wish to read it again, hit R."
  179. 1790 IF Z$="D" OR Z$="d" THEN GOTO 1800 ELSE COLOR 14,0:PRINT"    To run letters entered again, reverse or make diskfile, hit A."
  180. 1800 INPUT"                       To quit enter X, or to start over enter S.";W$
  181. 1810 IF W$<>"R" AND W$<>"r" AND W$<>"A" AND W$<>"a" AND W$<>"S" AND W$<>"s" AND W$<>"X" AND W$<>"x" OR W$="" THEN PRINT:GOTO 1780
  182. 1820 IF W$="S" OR W$="s" THEN BEEP:PRINT"Are you sure?...............Enter N to stop  ":QQ$=INPUT$(1):IF QQ$="N" OR QQ$="n" THEN COLOR 14,1:CLS:PRINT:GOTO 1780 ELSE COLOR 14,1:CLS:RUN 230
  183. 1830 IF W$="X" OR W$="x" THEN COLOR 14,1:GOSUB 1880:COLOR 14,1:CLS:PRINT:GOSUB 2090:GOSUB 1890:GOSUB 1910:PRINT:COLOR 14,6:PRINT"SKIP10.EXE terminated.":COLOR 14,1:END
  184. 1840 IF W$="A" OR W$="a" AND N < 253 THEN P$="":CLOSE:COLOR 14,1:CLS:GOTO 520
  185. 1850 IF W$="R" OR W$="r" THEN P$="":COLOR 14,1:CLS:E$="":COLOR 14,4:PRINT:PRINT"To read your diskfile ";R$;", enter the name again.":CLOSE:PRINT:GOTO 2170
  186. 1860 IF Z$="D" OR Z$="d" AND W$="A" OR W$="a" THEN CLS:COLOR 14,1:PRINT:PRINT "To read your diskfile again, enter ";R$:CLEAR:COLOR 14,1:GOTO 2170
  187. 1870 IF N > 252 AND W$="A" OR W$="a" THEN W$="R":GOTO 1850
  188. 1880 IF W$="X" OR W$="x" THEN BEEP:INPUT"Are you sure?...............Enter N to stop  ";WW$:IF WW$="N" OR WW$="n" THEN COLOR 14,1:CLS:GOTO 1780 ELSE RETURN
  189. 1890 IF R$="" THEN RETURN ELSE GOTO 1900
  190. 1900 CLOSE:COLOR 14,4:PRINT:PRINT"To erase the file -";R$;"- hit X, otherwise hit RETURN":PRINT:SS$=INPUT$(1):IF SS$="X" OR SS$="x" THEN PRINT:PRINT" Diskfile ";R$;" erased.":KILL R$:RETURN ELSE RETURN
  191. 1910 IF SS$="X" OR SS$="x" THEN RETURN ELSE GOTO 1920
  192. 1920 IF R$="" THEN RETURN ELSE COLOR 14,4:PRINT"To rename the file -";R$;"- hit X, otherwise hit RETURN":GOTO 1930
  193. 1930 TT$=INPUT$(1):IF TT$=CHR$(13) THEN RETURN ELSE COLOR 14,1:PRINT "Enter new name."
  194. 1940 LINE INPUT DD$
  195. 1950 NAME R$ AS DD$
  196. 1960 PRINT:PRINT "File renamed ";DD$:RETURN
  197. 1970 END
  198. 1980  F=0:L=N+1
  199. 1990 COLOR 14,1
  200. 2000 F=F+1:L=L-1
  201. 2010 IF F=L THEN GOTO 2050
  202. 2020 IF F=L+1 THEN GOTO 2050
  203. 2030 SWAP M(F),M(L)
  204. 2040 GOTO 2000
  205. 2050 COLOR 11,1:PRINT"Ciphertext reversed is:"
  206. 2060 COLOR 14,1
  207. 2070 RETURN
  208. 2080 END
  209. 2090 IF R$ <> "" THEN COLOR 11,1:PRINT:PRINT"Last file made or read was ";R$:GOTO 2100
  210. 2100 IF N > 1 THEN COLOR 14,1:PRINT:FOR J%=1 TO N:PRINT CHR$(M(J%));" ";:NEXT J% ELSE RETURN
  211. 2110 IF N > 1 THEN COLOR 11,1:PRINT"(Last";N;"letters)":COLOR 14,1:J%=0:RETURN
  212. 2120 END
  213. 2130 CLOSE
  214. 2140 OPEN"O",#1,R$
  215. 2150 PRINT#1, E$;
  216. 2160 CLOSE #1:RETURN
  217. 2170 K=0:COLOR 14,1:PRINT"Files available are (None with extensions listed):":PRINT:FILES"????????"
  218. 2180 PRINT"            (Limit is about 8000 characters.)"
  219. 2190 INPUT"Enter name of file to read ";R$:
  220. 2200 ON ERROR GOTO 3290
  221. 2210 IF R$<>"" THEN GOTO 2230 ELSE COLOR 10,4:INPUT"To reverse ciphertext enter D, otherwise hit Return  ";P$:COLOR 14,1:CLS
  222. 2220 IF R$="" THEN CLS:PRINT:PRINT"You must enter a filename.":GOTO 2170 ELSE CLS:PRINT
  223. 2230 IF R$="MYFILE" THEN E$="":
  224. 2240 COLOR 10,4:INPUT"To reverse ciphertext enter D, otherwise hit Return  ";P$:COLOR 14,1
  225. 2250 COLOR 9,0:LOCATE 25,1:PRINT" Pause-Break to stop scrolling, X to exit. Diskfile is ";R$;:IF P$="D" OR P$="d" OR V$="D" OR V$="d" THEN PRINT " reversed.":COLOR 14,1:LOCATE 2,1 ELSE PRINT:COLOR 14,1:LOCATE 3,1
  226. 2260 IF P$="D" OR P$="d" OR V$="D" OR V$="d" THEN CLS 2:COLOR 11,1:PRINT "Ciphertext is reversed":COLOR 14,1 ELSE CLS 2:COLOR 11,1:PRINT"Ciphertext is:":COLOR 14,1
  227. 2270 COLOR 14,1:OPEN"I",#1,R$
  228. 2280 IF P$="" THEN GOTO 2290 ELSE IF P$="D" OR P$="d" THEN GOTO 2310
  229. 2290 IF P$="" THEN INPUT #1,E$:GOSUB 2300:GOTO 2340
  230. 2300 FOR J=1 TO LEN(E$):I$=MID$(E$,J,1):MID$(E$,J,1)=CHR$(ASC(I$) AND 223):NEXT J:RETURN
  231. 2310 IF P$="D" OR P$="d" THEN INPUT #1,E$:GOSUB 2320:GOTO 2330
  232. 2320 FOR J=1 TO LEN(E$):I$=MID$(E$,J,1):MID$(E$,J,1)=CHR$(ASC(I$) AND 223):NEXT J:RETURN
  233. 2330 T$=E$:E$="":FOR A=LEN(T$) TO 1 STEP-1:U=ASC(MID$(T$,A,1)):PRINT CHR$(U);" ";:E$=E$+CHR$(U):FOR JJ=1 TO (K*20):NEXT JJ:NEXT A:GOTO 2350
  234. 2340 COLOR 14,1:FOR A=1 TO LEN(E$):PRINT MID$(E$,A,1);" ";:FOR JJ=1 TO (K*20):NEXT JJ:NEXT A
  235. 2350 IF LEN(E$)<3 THEN GOTO 3290 ELSE COLOR 14,6:PRINT LEN(E$);"letters.":GOTO 760
  236. 2360 PRINT:PRINT"     In order to prepare a file for use with this program, do the following:"
  237. 2370 PRINT"1. With your word processor SAVE your 'Shakespeare' file as an ASCII file."
  238. 2380 PRINT"2. Stage directions and the character's names (both in italics in the"
  239. 2390 PRINT"   original) should be erased. Using 'find and replace,' do the following:"
  240. 2400 PRINT"3. Remove quotation marks AND commas. Put ONE quotation mark AT THE BEGINNING."
  241. 2410 PRINT"4. Save the result as an ASCII file. This can then be processed by ASCIFILE."
  242. 2420 COLOR 14,4:PRINT"     In contemporary editions the printing of the INITIAL capital letters "
  243. 2430 PRINT" has usually been accurately preserved, and these may be taken as reliable.":COLOR 14,1
  244. 2440 PRINT"     However the spelling in most Shakespeare texts has been modernized,"
  245. 2450 PRINT" so the results may be doubtful.  There are several facsimile editions"
  246. 2460 PRINT" of the 1623 Folio, one being 'Mr. William Shakespeares Comedies,"
  247. 2470 PRINT" Histories & Tragedies', Yale University Press, 1954 and later printings."
  248. 2480 PRINT" There are also facsimiles of the early quarto editions of the plays and"
  249. 2490 PRINT" poems. With these you can check your own copy; most good libraries"
  250. 2500 PRINT" have them, and a Xerox machine."
  251. 2510 PRINT"                            Good hunting.";SPC(10);"Penn Leary"
  252. 2520 PRINT" Version 2.4, 3/26/92";SPC(30);"218 So. 95"
  253. 2530 PRINT" Contributed to the public domain.";SPC(17);"Omaha NE 68114":PRINT
  254. 2540 PRINT" To run ASCIFILE program hit A, otherwise hit return."
  255. 2550 PRINT" To view an index of occurrences of Bacon's name, hit B, otherwise hit return."
  256. 2560 PRINT " (To select B, the file INDEX2.EXE must be on this directory.)
  257. 2570 W$=INPUT$(1):GOSUB 3240
  258. 2580 CLS:IF W$="A" OR W$="a" THEN CLEAR:GOTO 2620
  259. 2590 IF W$="B" OR W$="b" THEN CLS:GOTO 3260
  260. 2600 RETURN
  261. 2610 END
  262. 2620 CLS
  263. 2630 DEFINT A-Z
  264. 2640 DIM T(1024),I(1024),K(1024),N(1024),G(1024),A(1024),B(1024),J(1024)
  265. 2650 PRINT:PRINT"This file will convert an ASCII file containing spaces, punctuation, etc."
  266. 2660 PRINT"to a file readable by SKIP10.EXE. J will be converted to I; W and U will"
  267. 2670 PRINT"be converted to V, and X and Z will be discarded."
  268. 2680 COLOR 10,4:PRINT"Remove all quotation marks AND commas with your word processor.":COLOR 14,1
  269. 2690 PRINT"                LIMIT, ABOUT 8000 CHARACTERS."
  270. 2700 PRINT"All letters will be capitalized and output to a new file."
  271. 2710 COLOR 14,1:PRINT"Files available are (None with extensions listed):":PRINT:FILES"????????"
  272. 2720 INPUT"Enter name of file to read.";R$
  273. 2730 IF R$="" THEN BEEP:PRINT:PRINT"You must enter a filename. Hit a key and start over.":W$=INPUT$(1):CLEAR:CLS:GOTO 10
  274. 2740 COLOR 10,4:PRINT"Diskfile = ";R$;":";:COLOR 11,1:PRINT:PRINT"Ciphertext is:":COLOR 14,1
  275. 2750 OPEN"I",#1,R$
  276. 2760 INPUT #1,A$
  277. 2770 COLOR 14,1:FOR A=1 TO LEN(A$)
  278. 2780 PRINT MID$(A$,A,1);
  279. 2790 NEXT A
  280. 2800 PRINT:PRINT LEN(A$);" Characters."
  281. 2810 CLOSE
  282. 2820 FOR G=1 TO LEN(A$):CC$=MID$(A$,G,1):MID$(A$,G,1)=CHR$(ASC(CC$) AND 223):NEXT G
  283. 2830 FOR N=1 TO LEN(A$)
  284. 2840 B=ASC(MID$(A$,N,1))-64
  285. 2850 J=J+1
  286. 2860 T(J)=B
  287. 2870 NEXT N
  288. 2880 I=0
  289. 2890 FOR K=1 TO J
  290. 2900 IF T(K)<1 OR T(K)>25 THEN T(K)=0:GOTO 2980
  291. 2910 IF T(K)=23 OR T(K)=21 THEN T(K)=22
  292. 2920 IF T(K)=10 THEN T(K)=9
  293. 2930 IF T(K)=24 THEN GOTO 2980
  294. 2940 I=I+1
  295. 2950 T(I)=T(K)
  296. 2960 D$=CHR$(T(I)+64)
  297. 2970 C$=C$+D$
  298. 2980 NEXT K
  299. 2990 PRINT C$
  300. 3000 A$=C$
  301. 3010 PRINT"=";I;"Squeezed and capitalized ciphertext letters converted to"
  302. 3020 PRINT"     Bacon's 21 letter alphabet. (Hit a key)"
  303. 3030 W$=INPUT$(1):CLS
  304. 3040 PRINT:PRINT"Next make a diskfile for the new ASCII ciphetext."
  305. 3050 PRINT:PRINT"Files on disk are:"
  306. 3060 FILES"????????"
  307. 3070 PRINT SPC(13);"Enter a name for the new disk file"
  308. 3080 PRINT SPC(12);"(maximum of 8 letters, no extension)":PRINT
  309. 3090 INPUT"CAUTION: If the name you enter exists, it will be ERASED and written over          ";Z$:COLOR 14,1:PRINT
  310. 3100 IF Z$="" THEN BEEP:PRINT:PRINT"You must enter a name. Hit a key and start over.":W$=INPUT$(1):CLEAR:CLS:GOTO 20
  311. 3110 OPEN"O",#1,Z$
  312. 3120 PRINT#1, A$
  313. 3130 CLOSE #1
  314. 3140 OPEN"I",#1,Z$
  315. 3150 INPUT #1,A$
  316. 3160 COLOR 10,0:PRINT"Contents of new diskfile ";Z$;" is:":COLOR 14,1:PRINT
  317. 3170 PRINT A$
  318. 3180 CLOSE
  319. 3190 PRINT"To run again hit A; to exit hit Return."
  320. 3200 W$=INPUT$(1):IF W$="A" OR W$="a" THEN CLEAR:GOTO 2620 ELSE CLEAR:CLS:GOTO 20
  321. 3210 END
  322. 3220 IF CHR$(T)="B" OR CHR$(T)="N" THEN COLOR 11,1:PRINT CHR$(T+32);" ";:RETURN ELSE COLOR 14,1:PRINT CHR$(T+32);" ";:RETURN
  323. 3230 IF MID$(T$,Q,1)="B" OR MID$(T$,Q,1)="N" THEN COLOR 11,1:PRINT MID$(T$,Q,1);:RETURN:ELSE COLOR 14,1:PRINT MID$(T$,Q,1);:RETURN
  324. 3240 IF ASC(W$)=88 OR ASC(W$)=120 THEN PRINT:GOTO 1780 ELSE RETURN
  325. 3250 END
  326. 3260 SHELL "INDEX2"
  327. 3270 GOTO 10
  328. 3280 END
  329. 3290 IF ERR=53 THEN COLOR 14,4:PRINT "The file ";R$;" was not found, so enter a corrected file name.":W$=INPUT$(1):CLEAR:RUN 10 ELSE GOTO 3300
  330. 3300 IF ERR=58 THEN DD$="":PRINT:PRINT"Error--you entered an existing file name.":RESUME 1920 ELSE GOTO 3310
  331. 3310 CLS:COLOR 14,4:LOCATE 21,1:PRINT "The file ";R$;" is not in SKIP10 format or is too long."
  332. 3320 PRINT"Run SKIP10 again, hit M and then A for formatting instructions."
  333. 3330 PRINT"Hit a key to start over.                 ":W$=INPUT$(1):COLOR 11,1:CLEAR:RUN 10
  334.