Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1,5 +1,4 @@
|
|||
const
|
||||
(
|
||||
const (
|
||||
key = "]kYV}(!7P\$n5_0i R:?jOWtF/=-pe'AD&@r6%ZXs\"v*N[#wSl9zq2^+g;LoB`aGh{3.HIu4fbK)mU8|dMET><,Qc\\C1yxJ"
|
||||
text = "The quick brown fox jumps over the lazy dog, who barks VERY loudly!"
|
||||
)
|
||||
|
|
|
|||
31
Task/Substitution-cipher/XPL0/substitution-cipher.xpl0
Normal file
31
Task/Substitution-cipher/XPL0/substitution-cipher.xpl0
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
include xpllib; \for StrLen, Print
|
||||
char Key;
|
||||
|
||||
func Index(S, C);
|
||||
char S, C, I;
|
||||
[for I:= 0 to StrLen(S)-1 do
|
||||
if S(I) = C then return I;
|
||||
return -1;
|
||||
];
|
||||
|
||||
func Encode(S);
|
||||
char S, I;
|
||||
[for I:= 0 to StrLen(S)-1 do
|
||||
S(I):= Key(S(I)-32);
|
||||
return S;
|
||||
];
|
||||
|
||||
func Decode(S);
|
||||
char S, I;
|
||||
[for I:= 0 to StrLen(S)-1 do
|
||||
S(I):= Index(Key, S(I)) + 32;
|
||||
return S;
|
||||
];
|
||||
|
||||
char S, Enc;
|
||||
[Key:= "]kYV}(!7P$n5_0i R:?jOWtF/=-pe'AD&@r6%ZXs^"v*N[#wSl9zq2^^+g;LoB`aGh{3.HIu4fbK)mU8|dMET><,Qc\C1yxJ";
|
||||
S:= "The quick brown fox jumps over the lazy dog, who barks VERY loudly!";
|
||||
Enc:= Encode(S);
|
||||
Print("Encoded: %s\n", Enc);
|
||||
Print("Decoded: %s\n", Decode(Enc));
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue