RosettaCodeData/Task/Rot-13/Objeck/rot-13.objeck
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

25 lines
544 B
Text

bundle Default {
class Rot13 {
function : Main(args : String[]) ~ Nil {
Rot13("nowhere ABJURER")->PrintLine();
}
function : native : Rot13(text : String) ~ String {
rot := "";
each(i : text) {
c := text->Get(i);
if(c >= 'a' & c <= 'm' | c >= 'A' & c <= 'M') {
rot->Append(c + 13);
}
else if(c >= 'n' & c <= 'z' | c >= 'N' & c <= 'Z') {
rot->Append(c - 13);
}
else {
rot->Append(c);
};
};
return rot;
}
}
}