RosettaCodeData/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0

14 lines
310 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
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
]