[Question]
  [
# Task
Read a string of characters and produce the [ROT13](http://en.wikipedia.org/wiki/Rot13) of it. All characters besides `[a-zA-Z]` should be output verbatim. Each letter in the output may be in any case you wish (you do not have to preserve it).
ROT13 is a simple substitution cipher where each letter of the alphabet is rotated by 13 places (it doesn't matter whether you do it forward or backward, since ROT13 is it's own inverse).
# Examples
```
Input
Output
Hello, world!
Uryyb, jbeyq!
Code Golf and Coding Challenges is awesome.
Pbqr Tbys naq Pbqvat Punyyratrf vf njrfbzr.
Mod abuse!1!!1
Zbq nohfr!1!!1
```
  
[Answer]
# Bash, 23 bytes
Canonical 23-character answer:
```
tr A-Za-z N-ZA-Mn-za-m
```
[Answer]
# Python 2, 34 bytes
```
print raw_input().encode('rot13')
```
[Answer]
## Bash - 5 chars
```
rot13
```
 
[Answer]
## Befunge - 7x30 = 210 6x26 = 156 characters
New streaming version that supports both upper and lower case and should support unlimited input.
```
v,<               <<     <
  ^-4-9<    >:"A"\`|
     >:"a"\`|     #>:"Z"`|
>~:0`| #    >:"z"`|
,    @ |    <`"m":<v`"M":<
^  +4+9<    ^      <
```
### The old version
This stores the values inside its own source code. Really shows off how horrible it is to try and output stored values in the same order that you receive them. Only supports lowercase characters.
```
vp0p11:+1g11<      < <
v                    ^-4-9<
v    >:"a"\`|>:"z"`|>:"m"`|
>~:0`|      >^     >^#
                     ^+4+9<
     >$011g1+0p>12g1+:12p0g:v
               ^           ,_@
```
I'm not sure exactly what limitations this has, using <http://www.quirkster.com/iano/js/befunge.html> as the interpreter it does appear to break with large inputs.
[Answer]
## Ruby - 60 57 38 37 chars
Edit: And just realised Ruby strings have a `tr` method.
```
puts$<.read.tr'A-Za-z','N-ZA-Mn-za-m'
```
### Test
```
input = "The challenge: To read an input of arbitrary length and produce the ROT13 of the input. All characters besides A-Z should be copied to the output verbatim, and case should be preserved if possible.
Any language that can read and write standard streams is fair game."
output = `echo '#{input}' | ruby golf-rot13.rb`
puts "Input:"
puts input
puts "-------"
puts "Output:"
puts output
```
Gives:
```
Input:
The challenge: To read an input of arbitrary length and produce the ROT13 of the input. All characters besides A-Z should be copied to the output verbatim, and case should be preserved if possible.
Any language that can read and write standard streams is fair game.
-------
Output:
Gur punyyratr: Gb ernq na vachg bs neovgenel yratgu naq cebqhpr gur EBG13 bs gur vachg. Nyy punenpgref orfvqrf N-M fubhyq or pbcvrq gb gur bhgchg ireongvz, naq pnfr fubhyq or cerfreirq vs cbffvoyr.
Nal ynathntr gung pna ernq naq jevgr fgnaqneq fgernzf vf snve tnzr.
```
[Answer]
# vim, 5 keystrokes
Assuming normal mode and that the text is already written in the buffer:
`g``g``g``?``G`
Or, fallowing vimgolf's conventions:
`g``?``G``Z``Z`
You can also invoke it as a terminal command, something like this:
```
$ vim -c 'norm g?G' -
< your text here ...
... multiple lines if you want ...
... terminate input with ctrl+D on a blank line >
```
I guess the latter would count as a "program" of 8 characters (`norm g?G`)
[Answer]
# R, 37 bytes
```
example("chartr");cat(rot(scan(,"")))
```
`example("chartr")` runs the examples for `chartr`, which includes the `rot` function, which is `ROT13` by default....
[Answer]
## C - 83 79 characters
```
main(c,b){while((c=getchar())>=0)b=c&96,putchar(isalpha(c)?b+1+(c-b+12)%26:c);}
```
Readable version:
```
#include <ctype.h>
#include <stdio.h>
int main(void)
{
    int c, base;
    while ((c = getchar()) >= 0) {
        if (isalpha(c)) {
            base = (c & 96) + 1; /* First letter of the upper or lower case. */
            c = base + (c - base + 13) % 26;
        }
        putchar(c);
    }
    return 0;
}
```
[Answer]
## Python (117 bytes)
Here's a Python version that avoids the `rot13()`-method.
```
import sys
print"".join([chr(x/32*32+1+(x%32+12)%26if 64<x<91or 96<x<123 else x)for x in map(ord,sys.stdin.read())])
```
[Answer]
`tr///` solution in Perl (39 characters), boilerplate can be removed with `-p`:
```
while(<>){y/a-zA-Z/n-za-mN-ZA-M/;print}
```
Using `-p` (23 characters including the extra switch):
```
perl -pe'y/a-zA-Z/n-za-mN-ZA-M/'
```
[Answer]
**DC (111 108 for the dc itself)**
Ok, here it is in (mostly) dc and some sed and od magic to get it into the right format for the code. If you don't count the input thing (`echo -n MESSAGE |`) it's 160 bytes:
```
od -An -t dC|sed 's/^\ *//;s/\ \{2,3\}/\n/g'|dc -e'[13+26%]sm[65-lmx65+]su[97-lmx97+]sl[96<b64<dPc]sa[91>c]sd[123>e]sb[lux]sc[llxdd]se[ddddlaxlrx]sy[?z0<y]dsrx'
```
As a point of interest, the *dc programme* itself is only a *108 bytes* long, shorter than the non-library python version. It even preserves case and punctuation, and *beats* Javascript in the above submission! If only I could better parse the output of od, or better yet replace it altogether.
EDIT: It's worth noting that the question doesn't indicate a trailing new line `10P` which saves me three further bytes.
EDIT 2: There's no specification for the format of the input, so I assume it's taken in as is convenient for my programme :P
[Answer]
# PHP - ~~103~~ ~~98~~ 80 characters
(not using str\_rot13())
```
<?=preg_replace('#[a-zA-Z]#e','chr(($x=ord("\0"))-$x%32+1+($x%32+12)%26)',`cat`);
```
[Answer]
## Haskell, 100 characters
```
a%b=([a..b]++)
main=interact$map$toEnum.((0%64$78%90$65%77$91%96$110%122$97%109$[123..])!!).fromEnum
```
[Answer]
# [LispLisp](https://github.com/SYZYGY-DEV333/LispLisp) (16,636)
I'm sorry.
```
((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
  (lisp lisp))
 (((lisp (lisp (lisp (lisp lisp))))
   ((lisp (lisp (lisp lisp)))
    ((lisp (lisp (lisp (lisp lisp))))
     (((lisp (lisp (lisp (lisp lisp))))
       ((lisp (lisp (lisp lisp)))
        (((lisp (lisp (lisp (lisp lisp))))
          (((lisp (lisp (lisp (lisp lisp))))
            ((lisp (lisp (lisp lisp)))
             (lisp (lisp (lisp (lisp lisp))))))
           (((lisp (lisp (lisp (lisp lisp))))
             ((lisp (lisp (lisp lisp)))
              (lisp (lisp (lisp lisp)))))
            (((lisp (lisp (lisp (lisp lisp))))
              ((lisp (lisp (lisp lisp)))
               (lisp (lisp (lisp (lisp lisp))))))
             (((lisp (lisp (lisp (lisp lisp))))
               ((lisp (lisp (lisp lisp)))
                ((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))))
              (lisp (lisp (lisp lisp))))))))
         ((lisp (lisp (lisp lisp)))
          (lisp (lisp (lisp lisp)))))))
      (((lisp (lisp (lisp (lisp lisp))))
        ((lisp (lisp (lisp lisp)))
         (((lisp (lisp (lisp (lisp lisp))))
           (((lisp (lisp (lisp (lisp lisp))))
             ((lisp (lisp (lisp lisp)))
              (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
               ((lisp (lisp (lisp lisp)))
                (lisp (lisp (lisp lisp)))))))
            (((lisp (lisp (lisp (lisp lisp))))
              (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
               ((lisp (lisp (lisp lisp)))
                (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                 ((lisp (lisp (lisp lisp)))
                  ((lisp (lisp (lisp lisp))) (lisp lisp)))))))
             ((lisp (lisp (lisp lisp)))
              (((((lisp (lisp (lisp (lisp lisp))))
                  (((lisp (lisp (lisp (lisp lisp))))
                    ((lisp (lisp (lisp lisp)))
                     (lisp (lisp (lisp (lisp lisp))))))
                   (lisp (lisp (lisp lisp)))))
                 ((((lisp (lisp (lisp (lisp lisp))))
                    ((lisp (lisp (lisp (lisp lisp))))
                     (((lisp (lisp (lisp (lisp lisp))))
                       ((lisp (lisp (lisp lisp)))
                        (lisp (lisp (lisp (lisp lisp))))))
                      (lisp (lisp (lisp lisp))))))
                   (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                    (lisp lisp)))
                  (((lisp (lisp (lisp (lisp lisp))))
                    (((lisp (lisp (lisp (lisp lisp))))
                      ((lisp (lisp (lisp lisp)))
                       (lisp (lisp (lisp (lisp lisp))))))
                     (lisp (lisp (lisp lisp)))))
                   (lisp lisp))))
                (((lisp (lisp (lisp (lisp lisp))))
                  ((lisp (lisp (lisp lisp)))
                   ((lisp (lisp (lisp (lisp lisp))))
                    (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                     ((lisp (lisp (lisp lisp))) (lisp lisp))))))
                 (lisp (lisp (lisp lisp)))))
               ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                 (((lisp (lisp (lisp (lisp lisp))))
                   ((lisp (lisp (lisp lisp)))
                    ((((lisp (lisp (lisp (lisp lisp))))
                       (((lisp (lisp (lisp (lisp lisp))))
                         ((lisp (lisp (lisp lisp)))
                          (lisp (lisp (lisp (lisp lisp))))))
                        (lisp (lisp (lisp lisp)))))
                      (lisp lisp))
                     ((((lisp (lisp (lisp (lisp lisp))))
                        (((lisp (lisp (lisp (lisp lisp))))
                          ((lisp (lisp (lisp lisp)))
                           (lisp (lisp (lisp (lisp lisp))))))
                         (lisp (lisp (lisp lisp)))))
                       (((lisp (lisp (lisp (lisp lisp))))
                         (((lisp (lisp (lisp (lisp lisp))))
                           ((lisp (lisp (lisp lisp)))
                            (lisp (lisp (lisp (lisp lisp))))))
                          (lisp (lisp (lisp lisp)))))
                        (lisp lisp)))
                      (((lisp (lisp (lisp (lisp lisp))))
                        ((lisp (lisp (lisp lisp)))
                         ((lisp (lisp (lisp (lisp lisp))))
                          (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                           ((lisp (lisp (lisp lisp))) (lisp lisp))))))
                       (lisp (lisp (lisp lisp))))))))
                  (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                   ((lisp (lisp (lisp lisp)))
                    ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                      (lisp lisp))
                     (((lisp (lisp (lisp (lisp lisp))))
                       ((lisp (lisp (lisp lisp)))
                        (((lisp (lisp (lisp (lisp lisp))))
                          ((lisp (lisp (lisp lisp)))
                           ((lisp (lisp (lisp (lisp lisp))))
                            (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                             ((lisp (lisp (lisp lisp))) (lisp lisp))))))
                         (lisp (lisp (lisp lisp))))))
                      (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                       (lisp lisp))))))))
                (((lisp (lisp (lisp (lisp lisp))))
                  ((lisp (lisp (lisp lisp)))
                   ((((lisp (lisp (lisp (lisp lisp))))
                      (((lisp (lisp (lisp (lisp lisp))))
                        ((lisp (lisp (lisp lisp)))
                         (lisp (lisp (lisp (lisp lisp))))))
                       (lisp (lisp (lisp lisp)))))
                     (((lisp (lisp (lisp (lisp lisp))))
                       ((lisp (lisp (lisp lisp)))
                        (((lisp (lisp (lisp (lisp lisp))))
                          (((lisp (lisp (lisp (lisp lisp))))
                            ((lisp (lisp (lisp lisp)))
                             (lisp (lisp (lisp (lisp lisp))))))
                           (lisp (lisp (lisp lisp)))))
                         (((lisp (lisp (lisp (lisp lisp))))
                           (((lisp (lisp (lisp (lisp lisp))))
                             ((lisp (lisp (lisp lisp)))
                              (lisp (lisp (lisp (lisp lisp))))))
                            (lisp (lisp (lisp lisp)))))
                          (lisp lisp)))))
                      ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                        (lisp lisp))
                       (((lisp (lisp (lisp (lisp lisp))))
                         (((lisp (lisp (lisp (lisp lisp))))
                           ((lisp (lisp (lisp lisp)))
                            (lisp (lisp (lisp (lisp lisp))))))
                          (lisp (lisp (lisp lisp)))))
                        (lisp lisp)))))
                    (((lisp (lisp (lisp (lisp lisp))))
                      ((lisp (lisp (lisp lisp)))
                       ((lisp (lisp (lisp (lisp lisp))))
                        (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                         ((lisp (lisp (lisp lisp)))
                          ((((lisp (lisp (lisp (lisp lisp))))
                             (((lisp (lisp (lisp (lisp lisp))))
                               ((lisp (lisp (lisp lisp)))
                                (lisp (lisp (lisp (lisp lisp))))))
                              (lisp (lisp (lisp lisp)))))
                            (((lisp (lisp (lisp (lisp lisp))))
                              ((lisp (lisp (lisp lisp)))
                               (((lisp (lisp (lisp (lisp lisp))))
                                 (((lisp (lisp (lisp (lisp lisp))))
                                   ((lisp (lisp (lisp lisp)))
                                    (lisp (lisp (lisp (lisp lisp))))))
                                  (lisp (lisp (lisp lisp)))))
                                (((lisp (lisp (lisp (lisp lisp))))
                                  (((lisp (lisp (lisp (lisp lisp))))
                                    ((lisp (lisp (lisp lisp)))
                                     (lisp (lisp (lisp (lisp lisp))))))
                                   (lisp (lisp (lisp lisp)))))
                                 (lisp lisp)))))
                             ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                               (lisp lisp))
                              (((lisp (lisp (lisp (lisp lisp))))
                                (((lisp (lisp (lisp (lisp lisp))))
                                  ((lisp (lisp (lisp lisp)))
                                   (lisp (lisp (lisp (lisp lisp))))))
                                 (lisp (lisp (lisp lisp)))))
                               (lisp lisp)))))
                           ((lisp (lisp (lisp (lisp lisp))))
                            (((lisp (lisp (lisp (lisp lisp))))
                              ((lisp (lisp (lisp lisp)))
                               (lisp (lisp (lisp (lisp lisp))))))
                             (lisp (lisp (lisp lisp)))))))))))
                     (lisp (lisp (lisp lisp)))))))
                 ((((lisp (lisp (lisp (lisp lisp))))
                    (((lisp (lisp (lisp (lisp lisp))))
                      ((lisp (lisp (lisp lisp)))
                       (lisp (lisp (lisp (lisp lisp))))))
                     (lisp (lisp (lisp lisp)))))
                   (((lisp (lisp (lisp (lisp lisp))))
                     ((lisp (lisp (lisp lisp)))
                      (((lisp (lisp (lisp (lisp lisp))))
                        (((lisp (lisp (lisp (lisp lisp))))
                          ((lisp (lisp (lisp lisp)))
                           (lisp (lisp (lisp (lisp lisp))))))
                         (lisp (lisp (lisp lisp)))))
                       (((lisp (lisp (lisp (lisp lisp))))
                         (((lisp (lisp (lisp (lisp lisp))))
                           ((lisp (lisp (lisp lisp)))
                            (lisp (lisp (lisp (lisp lisp))))))
                          (lisp (lisp (lisp lisp)))))
                        (lisp lisp)))))
                    ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                      (lisp lisp))
                     (((lisp (lisp (lisp (lisp lisp))))
                       (((lisp (lisp (lisp (lisp lisp))))
                         ((lisp (lisp (lisp lisp)))
                          (lisp (lisp (lisp (lisp lisp))))))
                        (lisp (lisp (lisp lisp)))))
                      (lisp lisp)))))
                  (((lisp (lisp (lisp (lisp lisp))))
                    ((lisp (lisp (lisp lisp)))
                     ((lisp (lisp (lisp (lisp lisp))))
                      (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                       ((lisp (lisp (lisp lisp)))
                        (((lisp (lisp (lisp (lisp lisp))))
                          ((lisp (lisp (lisp lisp)))
                           (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                            ((lisp (lisp (lisp lisp)))
                             (lisp (lisp (lisp lisp)))))))
                         (((lisp (lisp (lisp (lisp lisp))))
                           (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                            ((lisp (lisp (lisp lisp)))
                             (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                              ((lisp (lisp (lisp lisp)))
                               ((lisp (lisp (lisp lisp))) (lisp lisp)))))))
                          ((lisp (lisp (lisp lisp)))
                           (((((lisp (lisp (lisp (lisp lisp))))
                               (((lisp (lisp (lisp (lisp lisp))))
                                 ((lisp (lisp (lisp lisp)))
                                  (lisp (lisp (lisp (lisp lisp))))))
                                (lisp (lisp (lisp lisp)))))
                              (((lisp (lisp (lisp (lisp lisp))))
                                ((lisp (lisp (lisp lisp)))
                                 (((lisp (lisp (lisp (lisp lisp))))
                                   (((lisp (lisp (lisp (lisp lisp))))
                                     ((lisp (lisp (lisp lisp)))
                                      (lisp (lisp (lisp (lisp lisp))))))
                                    (lisp (lisp (lisp lisp)))))
                                  (((lisp (lisp (lisp (lisp lisp))))
                                    (((lisp (lisp (lisp (lisp lisp))))
                                      ((lisp (lisp (lisp lisp)))
                                       (lisp (lisp (lisp (lisp lisp))))))
                                     (lisp (lisp (lisp lisp)))))
                                   (lisp lisp)))))
                               ((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                                 (lisp lisp))
                                (((lisp (lisp (lisp (lisp lisp))))
                                  (((lisp (lisp (lisp (lisp lisp))))
                                    ((lisp (lisp (lisp lisp)))
                                     (lisp (lisp (lisp (lisp lisp))))))
                                   (lisp (lisp (lisp lisp)))))
                                 (lisp lisp)))))
                             (((lisp (lisp (lisp (lisp lisp))))
                               ((lisp (lisp (lisp lisp)))
                                ((lisp (lisp (lisp (lisp lisp))))
                                 (((lisp (lisp (lisp (lisp lisp))))
                                   (lisp lisp))
                                  ((lisp (lisp (lisp lisp))) (lisp lisp))))))
                              (lisp (lisp (lisp lisp)))))
                            (((((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
                               (lisp lisp))
                              (((lisp (lisp (lisp (lisp lisp))))
                                ((lisp (lisp (lisp lisp)))
                                 ((lisp (lisp (lisp (lisp lisp))))
                                  (((lisp (lisp (lisp (lisp lisp))))
                                    ((lisp (lisp (lisp lisp)))
                                     (lisp (lisp (lisp (lisp lisp))))))
                                   (((lisp (lisp (lisp (lisp lisp))))
                                     ((lisp (lisp (lisp lisp)))
                                      ((lisp (lisp (lisp (lisp lisp))))
                                       (lisp lisp))))
                                    (lisp (lisp (lisp lisp))))))))
                               (((lisp (lisp (lisp (lisp lisp))))
                                 ((lisp (lisp (lisp lisp)))
                                  ((lisp (lisp (lisp (lisp lisp))))
                                   ((lisp (lisp (lisp lisp)))
                                    (lisp (lisp (lisp lisp)))))))
                                (((lisp (lisp (lisp (lisp lisp))))
                                  (((lisp (lisp (lisp (lisp lisp))))
                                    ((lisp (lisp (lisp lisp)))
                                     (lisp (lisp (lisp (lisp lisp))))))
                                   (((lisp (lisp (lisp (lisp lisp))))
                                     ((lisp (lisp (lisp lisp)))
                                      (lisp (lisp (lisp lisp)))))
                                    (((lisp (lisp (lisp (lisp lisp))))
                                      (lisp lisp))
                                     (lisp lisp)))))
                                 ((lisp (lisp (lisp lisp)))
                                  ((lisp (lisp (lisp (lisp lisp))))
                                   (((lisp (lisp (lisp (lisp lisp))))
                                     ((lisp (lisp (lisp lisp)))
                                      (lisp (lisp (lisp (lisp lisp))))))
                                    (lisp (lisp (lisp lisp))))))))))
                             ((lisp (lisp (lisp lisp))) (lisp lisp))))))))))))
                   (lisp (lisp (lisp lisp))))))))))))
          (lisp lisp))))
       (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
        ((lisp (lisp (lisp lisp)))
         (lisp (lisp (lisp lisp))))))))))
  (((lisp (lisp (lisp (lisp lisp))))
    (((lisp (lisp (lisp (lisp lisp))))
      ((lisp (lisp (lisp lisp)))
       (lisp (lisp (lisp (lisp lisp))))))
     (((lisp (lisp (lisp (lisp lisp))))
       ((lisp (lisp (lisp lisp)))
        (lisp (lisp (lisp lisp)))))
      (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
       (lisp lisp)))))
   ((lisp (lisp (lisp lisp)))
    (((lisp (lisp (lisp (lisp lisp)))) (lisp lisp))
     ((lisp (lisp (lisp lisp)))
      ((lisp (lisp (lisp lisp))) (lisp lisp))))))))
```
[Answer]
Perl6 (54)
```
$*IN.lines».trans("a..zA..Z"=>"n..za..mN..ZA..M").say
```
[Answer]
## PHP - 41 Characters
```
while($r=fgets(STDIN))echo str_rot13($r);
```
[Answer]
## Delphi, 110
```
var c:Char;begin repeat Read(c);Write(Chr(Ord(c)+(Ord(c in['A'..'M'])-Ord(c in['N'..'Z']))*13));until EOF;end.
```
[Answer]
# C: 69 68 characters
Alright, I know this thread is long dead, but I couldn't stand the (long) C-solution which doesn't even compile on Clang (but does on GCC).
```
main(c){putchar(isalpha(c=getchar())*((c|32)<110?13:-13)+c);main();}
```
It is probably almost still squeezable. It certainly was squeezable. And not only was it squeezable, it was possible to make it recursive.
[Answer]
# [CHIQRSX9+](http://esolangs.org/wiki/CHIQRSX9%2B), 1
```
R
```
You just have to use the right tool for the problem.  
CHIQRSX9+ is Turing complete, and it can read and write from standard channels with `C`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~13~~ 12 bytes
Saved a byte thanks to *robbie0630*
```
ADu)øJD2äRJ‡
```
[Try it online!](https://tio.run/##MzBNTDJM/f/f0aVU8/AOLxejw0uCvB41LPz/3zUvOT8lVTckw7NYpyDH1bHYVREA "05AB1E – Try It Online")
**Explanation**
```
ADu           # push lower-case and uppercase alphabet
   )øJ        # zip, flatten and join, producing aAbB..zZ
      D2äRJ   # split a copy in 2 pieces, reverse and join producing nNoO..mM
           ‡  # translate input by replacing members of the alphabet 
              # with the corresponding member of the rot-13 alphabet
              # implicitly display
```
[Answer]
# x86-16 Machine Code, IBM PC DOS, 37 bytes
**Binary:**
```
00000000: b408 cd21 3c20 7e1c 8ad0 0c20 3c61 7c0e  ...!< ~.... <a|.
00000010: 3c7a 7f0a b60d 3c6e 7c02 b6f3 02d6 b402  <z....<n|.......
00000020: cd21 ebdc c3                             .!...
```
Build and test using `xxd -r`
**Unassembled listing:**
```
        START: 
B4 08       MOV  AH, 8          ; DOS API read char from STDIN (no echo) 
CD 21       INT  21H            ; read char into AL 
3C 20       CMP  AL, ' '        ; is any non-printable control char?
7E 1C       JL   EXIT           ; if so, end 
8A D0       MOV  DL, AL         ; save original char in DL 
0C 20       OR   AL, 'a'-'A'    ; lowercase the char 
3C 61       CMP  AL, 'a'        ; is char less than 'a'? 
7C 0E       JL   WRCHR          ; if so, do not convert 
3C 7A       CMP  AL, 'z'        ; is char greater than 'z'? 
7F 0A       JG   WRCHR          ; if so, do not convert 
B6 0D       MOV  DH, 'n'-'a'    ; add or subtract 13 
3C 6E       CMP  AL, 'n'        ; is char less than 'n'? 
7C 02       JL   ADD13          ; if so, add 13 
B6 F3       MOV  DH, 'a'-'n'    ; otherwise add -13 
        ADD13: 
02 D6       ADD  DL, DH         ; add 13 or -13
        WRCHR: 
B4 02       MOV  AH, 2          ; DOS API write char to STDOUT 
CD 21       INT  21H            ; write char in DL 
EB DC       JMP  START          ; keep looping 
        EXIT: 
C3           RET                ; return to DOS
```
As a standalone PC DOS executable program. Input is via `STDIN`, output to `STDOUT`.
[![enter image description here](https://i.stack.imgur.com/vBuQY.png)](https://i.stack.imgur.com/vBuQY.png)
Re-submitting answer to conform to `STDIN` challenge requirement.
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~200~~ ~~164~~ ~~113~~ 86 bytes
```
main(){char*s,*t=s;for(gets(s);*s;s++)isalpha(*s)?*s+=(*s&~32)<78?13:-13:0;printf(t);}
```
[Try it online!](https://tio.run/##DcY7DsIwDADQq8CCbKeVgA4gTNWVGzBboZ9IJqnibAiuHjo86fnWq8S51reECPjxi2SyhkpvPKUM81gMDJmMzTkMJrouAmQ4kLl@y@HXnfF@uQ6n7tZujrzmEMsEBflb62NUTc3umbK@9n8 "C (clang) – Try It Online")
This uses a for-loop which converts each letter into ROT13 using their ASCII values to use lesser bytes. `scanf()`'s parameters are now longer to include spaces in the string, since the previous code revision can't take spaces for input, so now it's longer.
Thanks to ceiling cat for golfing 36 bytes. Thanks to EasyasPi, with the help of ceilingcat, for golfing 51 bytes. Thanks to a stone arachnid for golfing 27 bytes.
[Answer]
**Java 251 chars**
```
public class r{public static void main(String[] a){String s = a[0];for(int i=0;i<s.length();){char c=s.charAt(i++);if(c>='a'&&c<='m')c+=13;else if(c>='n'&&c<='z')c-= 13;else if(c>='A'&&c<='M')c+=13;else if(c>='A'&&c <='Z')c-=13;System.out.print(c);}}}
```
[Answer]
# Python 3 (107)
Ok, I promise to stop answering this question now, but I felt compelled to beat the DC answer in Python. This probably reflects poorly on me as a person :).
```
import sys;[print(x.isalpha()and chr((ord(x)&96)+1+(ord(x)%32+12)%26)or x,end='')for x in sys.stdin.read()]
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 49 bytes
```
0i::"{`"@(@)*84**-::"AZ"@(@)+:}?$"4"-2d*%"A"+{?$o
```
[Try it online](https://tio.run/##S8sszvj/3yDTykqpOkHJQcNBU8vCREtLF8h3jALzta1q7VWUTJR0jVK0VJUclbSr7VXy///3SM3JyddRKM8vyklRBAA)
**Explanation**
`0i`  
On each loop we initialize the stack with **0** and an input character.  
`::"{`"@(@)*84**-`  
Convert lowercase letters into uppercase for easier future operations.
`::"AZ"@(@)+:}?$`  
If the character isn't an uppercase letter, use the **0** instead.
`"4"-2d*%"A"+`  
ROT-13 operation. Subtract **52**, mod by **13** and add **65** to get an uppercase letter.
`{?$`  
If the character wasn't an uppercase before the ROT-13 operations, use the saved character instead.
`o`  
Print as a character.
[Answer]
**JavaScript 1.8, 106**
`alert(prompt().replace(/\w/g,function(c)String.fromCharCode(c.charCodeAt()+(c.toLowerCase()<'n'?13:-13))))`
**JavaScript, 115**
`alert(prompt().replace(/\w/g,function(c){return String.fromCharCode(c.charCodeAt()+(c.toLowerCase()<'n'?13:-13))}))`
This solution solves the problem by adding 13 to the character code if the character in question is in the first half of the alphabet, or subtracting 13 if it's in the second half.
[Answer]
# Javascript (165)
```
a=prompt();y="ABCDEFGHIJKLMNOPQRSTUVWXYZ";b=y[s="substr"](13)+y[s](0,13);y+=y[l="toLowerCase"]();b+=b[l]();o='';for(i=0;a[i];i++)o+=b[y.indexOf(a[i])]||a[i];alert(o)
```
or (167) as previous Javascript solution, assuming readLine and print: 
```
a=readLine();y="ABCDEFGHIJKLMNOPQRSTUVWXYZ";b=y[s="substr"](13)+y[s](0,13);y+=y[l="toLowerCase"]();b+=b[l]();o='';for(i=0;a[i];i++)o+=b[y.indexOf(a[i])]||a[i];print(o)
```
[Answer]
## C, 136 bytes
I have never felt like any of my solutions are good enough to post on here, but made this for fun, and figured that it will be my gateway drug into code golf.
```
#define z(x) c>=x&&c<x+13
#define q(w) c>=w&&c<w+13
main(c){for(;(c=getchar())>=0;putchar(z('A')||z('a')?c+13:q('M')||q('m')?c-13:c));}
```
[Answer]
# Jolf, noncompeting (language postdates challenge)
Jolf, 3 bytes
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=LFJp)
```
,Ri
,R  rot13
  i the input
```
Or, with new implicit input, `,R`.
I'm sorry, but I'm not. I implemented this because it appears often in code-breaking puzzles, which I use Jolf a lot for, and recently used in an ARG. \o/
A longer one ([try that one here](http://conorobrien-foxx.github.io/Jolf/#code=z4FpIlslXSLOs3BXcHVkLnBXcDJwdSt0MyBpzrNI)):
```
ρi"[%]"γpWpud.pWp2pu+t3 iγH
ρi                           regex replace input
  "[%]"                      "[...]" following
        pWpu                 "abc...xyzABC....XYZ"
       γ                     γ = that
            d                functional replace
             .         _iγH  the index on the alphabet that the element is
                p2pu         shift uppercase alphabet
                    +t3      over thirteen
              pW             upper + lower of that
```
[Answer]
# [Julia 1.0](http://julialang.org/), 69 bytes
```
(x->(c=Char(x);print(c+isletter(c)*13*(-1)^(x&31>13)))).(read(stdin))
```
[Try it online!](https://tio.run/##FcmxCsIwEADQ3a84OshdpULIKHZQcRBBBGchpMGm1qRcEo3@fNS3viGNVolcCuamRb3e9oox02pi6yLqhQ2jidEwaqqFrLERdMU8l6IVkn6WyEZ1GGJnHVEp1aU3cE5W32HD/uVg7/PskB5TgNPTMPz7qD5v2Plb9QU "Julia 1.0 – Try It Online")
### Explanation
Most of the code is an anonymous function that takes an integer codepoint and prints the corresponding ROT-13'd character:
```
x->(c=Char(x);print(c+isletter(c)*13*(-1)^(x&31>13)))
x->(                                                )  # Anonymous function of x
    c=Char(x);                                         # Cast x to Char and save as c
                    c+                                 # Start with c and add to its codepoint:
                      isletter(c)*                     # If c is not a letter, the rest of this is
                                                       # multiplied by 0
                                  13*(-1)^(       )    # 13, times +/- 1 according to:
                                           x&31>13     # Low 5 bits of x are greater than 13
                                                       # I.e. x > 'M' (if x is uppercase) or x > 'm'
                                                       # (if x is lowercase)
              print(                               )   # Output the resulting character
```
We then apply this function, vectorized, to the array of (integer) codepoints returned by `read(stdin)`.
]