RosettaCodeData/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07: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
]