home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG095.ARC
/
CODER.WSF
< prev
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
45 lines
-- CODER --
Code≥á i≤á ß prograφ t∩ encodσ anΣ decodσ messages«á I⌠ work≤ oεá thσ ì
samσá principlσá a≤ thσ codσ wheel¼á wherσ yo⌡ havσ tw∩á wheel≤á witΦá thσ ì
alphabe⌠ writteε oε them¼á turninτ oε thσ samσ axis«á B∙ turninτ thσ oute≥ ì
wheel¼á thσá lette≥á ┴ oε thσ inne≥ whee∞ coulΣ bσ aligneΣ witΦá an∙á othe≥ ì
lette≥ oε thσ oute≥ wheel¼á givinτ ß tota∞ oµ 2╡ differen⌠ codes« (2╢ beinτ ì
thσ norma∞ alphabet)
Wheεá yo⌡ firs⌠ ruε thσ program¼á yo⌡ wil∞ bσ askeΣ iµ yo⌡ wisΦ t∩ usσ ì
thσ Encode≥ o≥ Decoder« A≤ yo⌡ typσ iε letters¼ yo⌡ wil∞ seσ wha⌠ yo⌡ typσ ì
iε a⌠ thσ top¼á anΣ thσ encoded/decodeΣ forφ belo≈ it«á Usσ DE╠ t∩ g∩ bacδ ì
iµ yo⌡ makσ ß mistake«á Pressinτ ▒ wil∞ causσ thσ encoded/decodeΣ forφá t∩ ì
bσá sen⌠ t∩ you≥ choicσ oµ ß paralle∞ printe≥ o≥ thσ VDU«á Pressinτ ▓ wil∞ ì
restar⌠ CODER.
Program name : CODER
00100 REM 'CODER' BY SIMON CARTER 28/2/1987 √▒┤╕²
00110 CLS : PRINT"Encoder or Decoder (E/D)" √▒╕╕²
00120 K1$=KEY$ : IF K1$="" THEN 120 ELSE IF K1$="E" : LET Z=1 :
GOTO 130 ELSE IF K1$="D" : LET Z=2 : GOTO 130 ELSE 120 √▓┤▓²
00130 CLS : W=1 : J=2 : L=0 : DIM S(500) √▒▓┤²
00140 INPUT"Please input code needed ( 1 - 25 )...";B √░╣╣²
00150 IF B<1 OR B>25 THEN GOTO 140 ELSE CURS W,J √░┤▓²
00160 K=ASC(KEY) : IF K=32 THEN LET N=K : GOTO 220 √▓░┤²
00170 IF K=49 THEN 250 ELSE IF K=50 THEN RUN √░││²
00180 IF K=127 AND W=1 AND J=2 THEN 160 ELSE IF K=127 : W=W-1 :
IF W<1 THEN LET J=J-2 : W=62 : GOTO 290 ELSE IF K=127 THEN 290 √▓│╡²
00190 IF Z=1 : IF K+B>90 THEN LET N=K+B-26 ELSE IF Z=1 : LET N=K+B √▓╡▓²
00200 IF Z=2 : IF K-B<65 THEN LET N=K-B+26 ELSE IF Z=2 : LET N=K-B √░░╕²
00210 IF K<65 THEN 160 ELSE IF K>90 THEN 160 √▒▒╕²
00220 CURS W,J+1 : PRINT CHR(N); : CURS W,J : PRINT CHR(K); √▓┤╢²
00230 LET S(L)=N : L=L+1 : W=W+1 : IF W=62 THEN LET J=J+2 : W=1 √▒▒▓²
00240 GOTO 160 √▒▒▒²
00250 CLS : PRINT"Output to printer or screen (P/S) ?"; √░┤┤²
00260 K1$=KEY$ : IF K1$="" THEN 260 ELSE IF K1$="S" THEN 280 √▒┤│²
00270 OUTL#1 : LPRINT B;" "; : FOR M=0 TO L : LPRINT CHR(S(M)); : NEXT M :
LPRINT : END √▓▓╣²
00280 CURS 128 : PRINT B;" "; : FOR M=0 TO L : PRINT CHR(S(M)); :
NEXT M : END √░╣╣²
00290 CURS W,J+1 : PRINT" "; : CURS W,J : PRINT" "; : L=L-1 : GOTO 160 √▒╣▓²