# Code that rot13s the output when it is rot13'd [closed]

In case the title was confusing, I mean something like the following C code:

main(){}znva(){}


When rot13 encoded, the code becomes

znva(){}main(){}


and still runs.

But that isn't a valid answer, because of these rules:

• Your code must produce output. Code that doesn't produce output is disqualified.
• The program can't be empty. That's disqualified too.
• The program can't be the same or similar to the output. This means that you can't use Golfscript or PHP.

In a valid answer, the program produces some output without being rot13'd, such as:

Hello, World!


And when the program is rot13'd, the output changes to the following:

Uryyb, Jbeyq!


which is the rot13 of Hello, World!.

Have fun!

## closed as unclear what you're asking by GamrCorps, TanMath, ETHproductions, Alex A.Dec 24 '15 at 3:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Is this code that produces an output when it is rot13'd? Or is it code that produces an output of itself rot13'd (that produces the original program)? – Justin Nov 18 '13 at 22:38
• Does the output have to contain letters? As it stands, . is a valid response in brainfuck. – Alex Gittemeier Nov 19 '13 at 1:55
• BTW: what is the objective winning criteria? – Johannes Kuhn Nov 19 '13 at 7:57
• @tbodt In the future, please refrain from changing a challenge's rules and/or judging criteria once it's been posted. If you would like to "test out" a challenge before posting it, in order to per-determine what rule modifications might be necessary, please use the current Sandbox thread in Meta. (Currently at Mk V.) – Iszi Nov 20 '13 at 1:01
• -1 Congratulations. You now have successfuly created a chamelion quesion. The statement "assuming they [the rules] don't change again" only shows that you can't answer this without your answer beeing invalidated. – Johannes Kuhn Nov 20 '13 at 7:54

## Ruby

$><<'Hello, world!'  Slightly less cheaty answer: s='Hello, world!'$-I?puts(s):chgf(s)

$-I?p(:a):c(:a)  • I changed the rules. Your second solution is the only one valid. – tbodt Nov 19 '13 at 19:20 • This is now a code golf contest. Shorten it up. – tbodt Nov 19 '13 at 23:27 ## Perl, 2514 12 characters I believe this adheres to all of the requirements: $_=a;fnl;say

Outputs a. After rot13 the program looks like this:
$_=n;say;fnl  and outputs n. • Does perl generate an error on encountering fnl? – tbodt Nov 19 '13 at 19:48 • @tbodt Without strict mode (and warnings) turned on, Perl will parse fnl as "fnl" (i.e. as a string). The statement then becomes a no-op expression. – breadbox Nov 19 '13 at 23:18 • Your solution is not disqualified. And you get an up vote. – tbodt Nov 19 '13 at 23:21 • This is now a code golf contest. Shorten it up. – tbodt Nov 19 '13 at 23:22 ## Brainf**k Since you never said the output had to actually be affected by rot13, this is totally a valid answer: -.  Not sure why it was downvoted, although it is kind of a cheap answer. • I changed the rules. histocrat's second solution is the only one valid. – tbodt Nov 19 '13 at 19:19 • add an letter at the end, and it will be valid. – Johannes Kuhn Nov 19 '13 at 21:04 • @JohannesKuhn Re-changed the rules. No comments. I think that I won't have to change them again. – tbodt Nov 19 '13 at 23:13 • You change the rules just to invalidate existing answers? – Johannes Kuhn Nov 20 '13 at 7:52 ### PHP 6 H<?//a  The program and its output differ by 83%, so not similar. a is not transformed into output, should satisfy all rules now. • I changed the rules. histocrat's second solution is the only one valid. – tbodt Nov 19 '13 at 19:19 • Because chameleon question. – Johannes Kuhn Nov 19 '13 at 19:33 • There I fixed it. – Johannes Kuhn Nov 19 '13 at 19:36 • What does that // do? And don't you need a ?> ending delimiter? – tbodt Nov 19 '13 at 19:52 • // is a comment. and no, I don't need an ending ?> – Johannes Kuhn Nov 19 '13 at 21:03 # bash, 64 chars _() { [[ "${1:0:1}" > U ]]&&rpub $@||echo$@; };_ Hello, Jbeyq.