25 lines
544 B
Text
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;
|
|
}
|
|
}
|
|
}
|