RosettaCodeData/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0
2023-07-01 13:44:08 -04:00

13 lines
310 B
Text

code ChIn=7, ChOut=8, IntIn=10;
int Key, C;
[Key:= IntIn(8);
repeat C:= ChIn(1);
if C>=^a & C<=^z then C:= C-$20;
if C>=^A & C<=^Z then
[C:= C+Key;
if C>^Z then C:= C-26
else if C<^A then C:= C+26;
];
ChOut(0, C);
until C=$1A; \EOF
]