June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
30
Task/Rot-13/Elena/rot-13.elena
Normal file
30
Task/Rot-13/Elena/rot-13.elena
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import system'routines.
|
||||
import extensions.
|
||||
|
||||
singleton rotConvertor
|
||||
{
|
||||
char convert(char ch)
|
||||
[
|
||||
if (($97 <= ch) && (ch <= $109) || ($65 <= ch) && (ch <= $77))
|
||||
[
|
||||
^ (ch toInt + 13) toChar
|
||||
].
|
||||
if (($110 <= ch) && (ch <= $122) || ($78 <= ch) && (ch <= $90))
|
||||
[
|
||||
^ (ch toInt - 13) toChar
|
||||
].
|
||||
|
||||
^ ch
|
||||
]
|
||||
|
||||
literal convert(literal s)
|
||||
= s selectBy(:ch)(rotConvertor convert(ch)); summarize(String new).
|
||||
}
|
||||
|
||||
program =
|
||||
[
|
||||
if ('program'arguments length > 1)
|
||||
[
|
||||
console printLine(rotConvertor convert('program'arguments[1])).
|
||||
]
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue