1
\$\begingroup\$

This question already has an answer here:

I'm new to this stackexchange, but I must say I am very impressed by the knowledge of some here, and the original codegolf answers for some questions.

I'm not even sure if the following is possible, since my programming language knowledge is very limited, but it sounds like a pretty interesting challenge:

Goal:

Output all the code you've used in reverse.

Rules:

  • Your code should contain Hello, World! (may be placed as comment)
  • You are not allowed to read the actual code-file itself
  • Nor are you allowed to read any generated compiler-code
  • Or a pre-prepared reversed.txt or something..

Like I said, I'm not sure if it's possible.

As an example, let's say you have the following code (Java):

class Main{public static void main(String[]a){System.out.print("Hello, World!");}}

Then the output of the program should be:

}};)"!dlroW ,olleH")tnirp.tuo.metsyS{)a][gnirtS(niam diov citats cilpub{naiM ssalc

Some sub-rules:

  • Any language, any OS, any API/tool
  • Any comments made should also be printed in reverse, so keep that in mind if you place Hello, World! in a comment

PS: I know the 'question' Print your code backwards - reverse quine exists, but because of that I added the first rule: Your code should contain Hello, World! as is (so this answer in H9+ that uses the reversed !dlorw olleH isn't allowed).

I think I don't have to explain the rules of here..

\$\endgroup\$

marked as duplicate by Martin Ender code-golf Apr 1 '16 at 9:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    \$\begingroup\$ Welcome to PPCG! Unfortunately, I don't think the addition of requiring the additional string Hello, World! in the code makes this sufficiently different from or more interesting than the existing question. There are many solutions from the old challenge, where the string can simply be inserted in one or two places without affecting the rest of the program at all. I hope you stick around and try your hand at writing further challenges though. You can also use the sandbox to get feedback on your challenge ideas before posting them on main. \$\endgroup\$ – Martin Ender Apr 1 '16 at 9:25
  • \$\begingroup\$ @MartinBüttner Hi Martin (you look familiar from the Puzzling stackexchange). Thanks for the link to the sandbox and the warm welcome, next time I will ask there first. Too be honest, I had written the entire question and then changed the title a bit. That was when I realized there was already a similar question. I decided to post it anyway with the rule I had already planned to make it slightly different, but you are indeed correct that they are almost the same, so I understand the Duplicated mark. \$\endgroup\$ – Kevin Cruijssen Apr 1 '16 at 9:46