YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
30
Task/Caesar-cipher/ZX-Spectrum-Basic/caesar-cipher-2.zx
Normal file
30
Task/Caesar-cipher/ZX-Spectrum-Basic/caesar-cipher-2.zx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
10 LET t$="Wonderful ZX Spectrum."
|
||||
20 LET c$="a":REM more characters, more difficult for decript
|
||||
30 LET CIFRA=1: LET DESCIFRA=-1
|
||||
40 PRINT t$''
|
||||
50 LET modo=CIFRA: GO SUB 1000
|
||||
60 PRINT r$''
|
||||
70 LET t$=r$: LET modo=DESCIFRA: GO SUB 1000
|
||||
80 PRINT r$''
|
||||
90 STOP
|
||||
1000 REM Criptex
|
||||
1010 LET p$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 .,;:()-"
|
||||
1020 LET longPatron=LEN p$
|
||||
1030 LET longTexto=LEN t$
|
||||
1040 LET longClave=LEN c$
|
||||
1045 LET k=0: LET r$=""
|
||||
1050 FOR i=1 TO longTexto
|
||||
1060 LET k=k+1: IF k>longClave THEN LET k=1
|
||||
1070 LET x$=t$(i)
|
||||
1080 FOR j=1 TO longPatron
|
||||
1090 IF x$=p$(j) THEN LET delta=j: GO TO 1110
|
||||
1100 NEXT j
|
||||
1110 LET x$=c$(k)
|
||||
1120 FOR j=1 TO longPatron
|
||||
1130 IF x$=p$(j) THEN LET delta=delta+modo*j: GO TO 1150
|
||||
1140 NEXT j
|
||||
1150 IF delta>longPatron THEN LET delta=delta-longPatron: GO TO 1170
|
||||
1160 IF delta<1 THEN LET delta=longPatron+delta
|
||||
1170 LET r$=r$+p$(delta)
|
||||
1180 NEXT i
|
||||
1190 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue