Rot-13: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: updated code) |
|||
Line 5,845: | Line 5,845: | ||
<syntaxhighlight lang="ruby"># Returns a copy of 's' with rot13 encoding. |
<syntaxhighlight lang="ruby"># Returns a copy of 's' with rot13 encoding. |
||
func rot13(s) { |
func rot13(s) { |
||
s.tr('A-Za-z', 'N-ZA-Mn-za-m') |
s.tr('A-Za-z', 'N-ZA-Mn-za-m') |
||
} |
} |
||
# Perform rot13 on standard input. |
# Perform rot13 on standard input. |
||
STDIN.each { |line| |
STDIN.each { |line| say rot13(line) }</syntaxhighlight> |
||
=={{header|Simula}}== |
=={{header|Simula}}== |
||
<syntaxhighlight lang="simula"> TEXT PROCEDURE ROT13(INP); TEXT INP; |
<syntaxhighlight lang="simula"> TEXT PROCEDURE ROT13(INP); TEXT INP; |