Sitenotice: 11/29/2018: The wiki is back. It turns out, some anti-virus product on my web server had an issue with the latest version of PHP. My server techs have resolved this issue, and things should be working again. During the investigation, I did restore to a backup from September. There is a chance that any changes done since then were lost, but I do not recall any edits. --OS-9 Al

8/30/2016: Massive re-work is being done on the InfoBox Templates. Read that page to keep up with the plan for that, and adding better keyword tags (categories) to all the pages. --OS-9 Al (talk) 15:28, 31 August 2016 (CDT)

CRYPTO

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Jump to navigation Jump to search
100 CLEAR 500: DIM T$(36,2)
110 DATA A,B,C,D,E,F,G,H,I ,J,K,L,M,N,O,P,Q,R,S
120 DATA T,U,V,W,X,Y,Z,0, 1,2,3,4,5,6,7,8,9
130 FOR I=1 TO 36: READ T$(I,1): NEXT I
140 CLS: PRINT@10,"CRYPTOGRAPHY"
150 PRINT@64,"SELECT ONE OF THE FOLLOWING:"
160 PRINT@96,"1. DECODE (CHANGE CODE TO"
170 PRINT@131,"ENGLISH) BY TABLE"
180 PRINT@160,"2. ENCODE (CHANGE ENGLISH TO"
190 PRINT@195,"CODE) BY TABLE"
200 PRINT@224,"WHICH ONE";: INPUT A$
210 IF A$="1" OR A$="2" THEN 250
220 PRINT@448,"INVALID SELECTION--TRY AGAIN"
230 FOR I=1 TO 300: NEXT I
240 PRINT@234,"": GOTO200
230 IF A$="1" THEN P$="CODE-TO-ENGLISH"
260 IF A$="2" THEN P$="ENGLISH-TO-CODE"
270 CLS: PRINT@8,P$
280 PRINT@64,"ENTER TABLE:"
290 FOR I=1 TO 36
300 IF I=1 THEN PP=98
310 IF I=27 THEN PP=194
320 PRINT@PP,T$(I,1);
330 PP=PP+1: NEXT I
340 FOR I=1 TO 36
350 IF I=1 THEN PP=129: B$="": C$=""
360 IF I=27 THEN PP=225: C$=""
370 IF B$=CHR$(13) THEN T$(I,2)=T$(I,1): GOTO450
380 PRINT@PP,"";: B$=INKEY$
390 IF B$="" THEN 380
400 IF B$=CHR$(13) THEN 370
410 C$=C$+B$: PRINT@PP+2-LEN(C$),C$
420 IF B$=CHR$(32) THEN T$(I,2)=T$(I,1): GOTO440
430 T$(I,2)=B$
440 PP=PP+1
450 NEXT I
460 IF A$="1" THEN A1=2: A2=1
470 IF A$="2" THEN A1=1: A2=2
480 CLS: PRINT@0,"ENTER TEXT TO BE TRANSLATED:"
490 PRINT@33,"(PRESS <ENTER> TO END)"
500 PL=32
510 IF PL<384 THEN PL=PL+64: GOTO550
520 PRINT@480,"PRESS ANY KEY TO CONTINUE";: B$=INKEY$
530 IF B$="" THEN 520
540 CLS: PL=0
550 PP=0: C$=""
560 PRINT@PL+PP,"";: B$=INKEY$
570 IF B$="" THEN 560
580 IF B$=CHR$(13) THEN GOSUB700: GOTO620
590 C$C$+BS: PRINT@PL+PP+2-LEN(C$),C$
600 IFLEN(C$)>29 THEN GOSUB700: GOTO510
610 PP=PP+1: GOTO560
620 PRINT@448,"PRESS N FOR NEW TABLE,"
630 PRINT@480,"1 FOR DECODE, OR 2 FOR ENCODE";: A$=INKEY$
640 IF A$="" THEN 630
650 IF A$="N" THEN 140
660 IF A$="1" OR A$="V' THEN 460
670 IF A$="1" OR A$="2" THEN 460
680 GOTO630
690 REM - PRINT TRANSLATED TEXT
700 L=LEN(C$): IF L<2 THEN 810
710 SOUND 125,3
720 PL=PL+32: PP=0: D$=""
730 FOR I=1 TO L
740 J=0: B$=MID$(C$,I,1)
750 IF J<36 THEN J=J+1: GOTO770
760 B$="*": GOTO790
770 IF B$=T$(J,A1) THEN B$=T$(J,A2): GOTO790
780 GOTO750
790 D$=D$+B$: PRINT@PL+PP+2-LEN(D$),D$
800 PP=PP+1: NEXT I
810 RETURN