`L i=L\Ʃx ? N'i  ͭЅ?0ȱ Ѕ?iȱi lԠԠ͠ԠϠŠͮŠ SYSTEM.APPLE   L$J D ^ѢEXTg4 DANMAC.TEXTvg PIG2.TEXTr=vg"CRYPTODOC.TEXTgLORES.UNIT.TEXTLIFE.LORES.TEXTLIFE.INFO.TEXTgLORES.INFO.TEXT DIS1.TEXTr=vgPLOTPOURRI.TEXT RNDSPIRO.TEXTvg" LORES.TEXT=vg PLOT.TEXTr=vgANDROMEDA.TPSCAL29CRYPTODOC.TEXTg CRYPTO.TEXTvg( FILER.LIBr=vga(PMINIFILER.TEXTgPTPAGEDUMPER.CODET\ IOUNITA.TEXTvg٠\b IOUNITB.TEXTvgbzLIFE.TURTL.TEXTzLORES.USER.TEXT&꽌ɪɖ'*&%&,E'зЮ꽌ɪФ`+*xH&x'8*7Ixix&&  ') + &п x) ++`FG8`0($ p,&") (jJJ>L+ "?I>  N `  ` x V Nx .x- z `V0^*^*>` aI꽌ɪVɭ&Y&&Y& 꽌ɪ\8`& DCRYPTO G 8Program by: William Schultheis  %CRYPTO is a program to help you solve short cryptograms such as those  published in the game sections of some newspapers.  % @*** WARNING ** ! *CRYPTO uses BIOSUNIT and the two procedures INVERSE anN^cedure  WRITEPLAIN uses this structure to generate the plaintext solution directly  from the cipher text array, CTEXT.  tters. The program also demonstrates  that the choice of good data structures can really simplify the code. The  status of the solution is contained in the array CTAB which is declared  ARRAY[ALPH] OF RECORD COUNT: INTEGER; PLAIN:CHAR END. The pro until the complete solution appears in the bottom window.  %The program uses fairly straightforward programming techniques. It does  show the power of Pascal set variables to indicate the set of legal inputs  and the set of available plaintext le previous  selection or assign nothing, enter a "/". If you assign a letter to a  cryptogram letter which already has something assigned, the program will  return the previous letter to the available set. Just keep assigning letters gn to the cipher letter. The  program displays a list of available (unused) letters between the two text  windows. If you select a letter which is already used, the computer will  beep at you and wait for another selection. If you want to delete athe work. The letter command prompts you to select  a letter of the alphabet. The letter you enter will be highlighted in  inverse video in the cryptogram and in the solution area at the bottom of the Next you enter the letter which you want to assi%The program displays a command line at the top of the screen. At the  top level of the program you have three commands, E)NTER, L)ETTER, and Q)UIT.  ENTER reruns the input routine. QUIT exits the program. LETTER is the  command that does most of ndow. If you flip to the second  page of the display, you will see a table showing the frequency of occurance  of letters in the cipher alphabet along with the plain text letter assigned  to each cipher letter, initially blank.  at a time. Terminate each line with a CR as you go and  indicate the end of the cryptogram by entering an empty line. The program  will pause a second and display the cryptogram in the top window of the  display and a solution are in the bottom wid *NORMAL. You will have to link the program with *BIOSUNIT.CODE and BIOSSTUFF.CODE. These routines WILL *NOT WORK with Apple Pascal Version 1.1!  %When you run the program it asks you to input the cipher text of a  cryptogram one linePROGRAM CRYPTO;  (* INPUT AND SOLVE A CRYPTOGRAM *)  USES BIOSUNIT;  TYPE #ALPH = 'A'..'Z'; #SETOFCHAR = SET OF CHAR;  VAR #CTEXT: ARRAY[1..5] OF STRING; #LAST: INTEGER; #CTAB: ARRAY[ALPH] OF RECORD ,COUNT: INTEGER; ,PLAIN: CHAR )END; #AVAILSE #SHOWTABLE  END;   BEGIN (*CRYPTO*) #FORMATSCREEN; #INPUT; #REPEAT &CMD:=READCMD('E(NTER, L(ETTER, Q(UIT',['E','L','Q']); &IF CMD = 'L' THEN LETTER; &IF CMD = 'E' THEN INPUT #UNTIL CMD = 'Q'  END.   ,AVAILSET:=AVAILSET+[CTAB[L].PLAIN]; )AVAILSET:=AVAILSET-[C]; )WRITE(C); )CTAB[L].PLAIN:=C &END; #SHOWAVAIL; #WRITETEXT; #WRITEPLAIN  END;   PROCEDURE INPUT;  BEGIN #READTEXT; #COUNTLETTERS; #WRITEPLAIN; #AVAILSET:=['A'..'Z']; #SHOWAVAIL;N DIV 13)*10,1+N MOD 13); #IF C='/' THEN &BEGIN )IF CTAB[L].PLAIN<>CHR(95) THEN ,BEGIN /WRITE(CHR(95)); /AVAILSET:=AVAILSET+[CTAB[L].PLAIN]; /CTAB[L].PLAIN:=CHR(95) ,END &END #ELSE &BEGIN )IF CTAB[L].PLAIN<>CHR(95) THEN 1,12+2*I); /WRITE(CTAB[L].PLAIN) ,END; #NORMAL  END;   PROCEDURE LETTER;  VAR C,L:CHAR; $N:INTEGER;  BEGIN #L:=READCMD('A..Z',['A'..'Z']); #MARKLETTER(L); #N:=ORD(L)-ORD('A'); #C:=READCMD('AVAIL: OR / TO CANCEL',AVAILSET+['/']); #GOTOXY(46+(IF C IN AVAILSET THEN WRITE(C) ELSE WRITE(' ')  END;   PROCEDURE MARKLETTER(L:CHAR);  VAR I,J:INTEGER;  BEGIN #INVERSE; #FOR I:=1 TO LAST DO &FOR J:=1 TO LENGTH(CTEXT[I]) DO )IF CTEXT[I,J]=L THEN ,BEGIN /GOTOXY(J-1,2*I); /WRITE(L); /GOTOXY(J-&READ(KEYBOARD,CH); &IF EOLN(KEYBOARD) THEN CH:=CHR(13); &GOOD:=CH IN OKSET; &IF NOT GOOD THEN WRITE(CHR(7)) #UNTIL GOOD; #READCMD:=CH  END;   PROCEDURE SHOWAVAIL;  VAR C:CHAR;  BEGIN #GOTOXY(0,12); #WRITE('AVAIL:'); #FOR C:='A' TO 'Z' DO &NT=0 THEN WRITE(' ') /ELSE WRITE(COUNT:3); /WRITE(' ',C,':',PLAIN) ,END &END  END;   FUNCTION READCMD(P:STRING;OKSET:SETOFCHAR):CHAR;  VAR CH:CHAR; $GOOD:BOOLEAN;  BEGIN #GOTOXY(0,0); #WRITE('CMD: ',P,CHR(29)); #REPEAT Z'] THEN 2WRITE(CTAB[C].PLAIN) /ELSE 2WRITE(C) ,END &END  END;   PROCEDURE SHOWTABLE;  VAR N:INTEGER; $C:CHAR;  BEGIN #FOR C:='A' TO 'Z' DO &BEGIN )N:=ORD(C)-ORD('A'); )GOTOXY(40+(N DIV 13)*10,1+N MOD 13); )WITH CTAB[C] DO ,BEGIN /IF COULAST DO &BEGIN )GOTOXY(0,2*I); )WRITE(CTEXT[I]) &END  END;   PROCEDURE WRITEPLAIN;  VAR I,J:INTEGER; # C:CHAR;  BEGIN #FOR I:=1 TO LAST DO &BEGIN )GOTOXY(0,12+2*I); )FOR J:=1 TO LENGTH(CTEXT[I]) DO ,BEGIN /C:=CTEXT[I,J]; /IF C IN ['A'..'&BEGIN COUNT:=0; PLAIN:=CHR(95) END; #FOR I:=1 TO LAST DO &FOR J:=1 TO LENGTH(CTEXT[I]) DO )BEGIN ,C:=CTEXT[I,J]; ,IF C IN ['A'..'Z'] THEN /CTAB[C].COUNT:=CTAB[C].COUNT+1 )END  END;   PROCEDURE WRITETEXT;  VAR I:INTEGER;  BEGIN #FOR I:=1 TO ) > 0 THEN )BEGIN CTEXT[I]:=S;I:=I+1 END; &INFO('ENTER TO END INPUT'); #UNTIL (I>5) OR (LENGTH(S)=0); #LAST:=I-1;  END;   PROCEDURE COUNTLETTERS;  VAR I,J:INTEGER; $C:CHAR;  BEGIN #FOR C:='A' TO 'Z' DO WITH CTAB[C] DO  PROCEDURE INFO(S:STRING);  BEGIN #GOTOXY(0,0); #WRITE(S,CHR(29))  END;   PROCEDURE READTEXT;  VAR I:INTEGER; $S:STRING;  BEGIN #INFO('ENTER UP TO 5 LINES OF TEXT'); #I:=1; #REPEAT &GOTOXY(0,2*I); &WRITE(CHR(29)); &READLN(S); &IF LENGTH(ST: SET OF ALPH; #CMD: CHAR; #  PROCEDURE FORMATSCREEN;  VAR I:INTEGER;  BEGIN #WRITE(CHR(12)); #GOTOXY(0,1); #FOR I:=0 TO 39 DO WRITE ('-'); #GOTOXY(0,11); #FOR I:=0 TO 39 DO WRITE ('-'); #GOTOXY(0,13); #FOR I:=0 TO 39 DO WRITE ('-')  END;