RosettaCodeData/Task/Substitution-cipher/Klingphix/substitution-cipher.klingphix

25 lines
433 B
Plaintext

include ..\Utilitys.tlhy
" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
" VsciBjedgrzyHalvXZKtUPumGfIwJxqOCFRApnDhQWobLkESYMTN"
"A simple example"
:Encode %mode !mode
%i %t
$mode not [rot rot swap rot] if
len [
!i
$i get swap !t
rot swap find
rot swap get
$t swap $i set
] for
$mode not [rot rot swap rot] if
;
dup ?
true Encode dup ?
false Encode ?
" " input