82
\$\begingroup\$

Write a program that prints its own source code out backwards, in other words an eniuq.

Scoring:

  • +50 if you use pull data from the Internet.
  • +25 if you read your own source code.
  • +1 point per character
  • Lowest score wins.

Rules:

  • No using other files (e.g. reverse.txt)
  • Minimum code length is two characters.
  • Your program cannot be a palindrome.
\$\endgroup\$
  • 1
    \$\begingroup\$ Looks like this has been done before, just without the "no palindromes" rule. \$\endgroup\$ – Iszi Dec 18 '13 at 18:59
  • 3
    \$\begingroup\$ Are those scores bonuses or penalties? You need to specify in words if something is a penalty or a bonus, because saying +10 can be taken to mean either "score as if it had 10 more characters than it actually does" or "the code can have 10 more characters that won't be scored", or other interpretations. \$\endgroup\$ – AJMansfield Dec 18 '13 at 20:24
  • 7
    \$\begingroup\$ @AJMansfield Lowest score wins means that +x would be a penalty, -x would be a bonus. \$\endgroup\$ – Iszi Dec 18 '13 at 20:32
  • 9
    \$\begingroup\$ The one question I have, then, is why is pulling data from the internet given a larger penalty than reading the source file? \$\endgroup\$ – AJMansfield Dec 18 '13 at 20:35
  • 4
    \$\begingroup\$ Woohoo, 1st place on the hot network questions list :D Our site needs more attention... \$\endgroup\$ – Doorknob Dec 19 '13 at 0:09

65 Answers 65

0
\$\begingroup\$

Befunge-93 (FBBI), 13 bytes

">:#,_98+2*,@

Try it online!

Relies on nonstandard interpreter behavior. Works pretty much the same as this answer, except it's reversed.

\$\endgroup\$
0
\$\begingroup\$

Jelly, 2 bytes

1-

Try it online!

Short but boring.

1 gets ignored when - makes -1 the argument which gets printed.

Jelly, 8 bytes

“ṚṾȮ”ȮṾṚ

Try it online!

(More) interesting but long.

“ṚṾȮ” is a string literal for ṚṾȮ. Ȯ prints the string and returns it. unevals the string, yielding the string “ṚṾȮ” (with the quote characters “” as part of the string). reverses this string and its result, ”ȮṾṚ“ implicitly gets printed.

\$\endgroup\$
0
\$\begingroup\$

Oracle SQL, 142 bytes

select
reverse(replace('@''[@'||chr(93)||'''))from dual;','@',q'[select
reverse(replace('@''[@'||chr(93)||'''))from dual;','@',q]'))from dual;

Oracle SQL, 118 bytes

select
reverse(substr(rpad(1,144,'||chr(39)),27))from dual;select
reverse(substr(rpad(1,144,'||chr(39)),27))from dual;

Test in SQL Plus

SQL> set lines 80 pages 0
SQL> select
  2  reverse(replace('@''[@'||chr(93)||'''))from dual;','@',q'[select
  3  reverse(replace('@''[@'||chr(93)||'''))from dual;','@',q]'))from dual;
;laud morf))']q,'@',';laud morf))'''||)39(rhc||'@[''@'(ecalper(esrever
tceles['q,'@',';laud morf))'''||)39(rhc||'@[''@'(ecalper(esrever
tceles


SQL> select
  2  reverse(substr(rpad(1,144,'||chr(39)),27))from dual;select
  3  reverse(substr(rpad(1,144,'||chr(39)),27))from dual;
;laud morf))72,))93(rhc||',441,1(dapr(rtsbus(esrever
tceles;laud morf))72,))93(rhc||',441,1(dapr(rtsbus(esrever
tceles
\$\endgroup\$
0
\$\begingroup\$

Gol><>, 6 bytes

sP#Hr"

This is just another way of doing a reverse quine, similar to Bubbler's answer

Try it online!

\$\endgroup\$
0
\$\begingroup\$

JavaScript, 33 32 bytes

f=([c,...s]='f='+f)=>c?f(s)+c:''

Recursively reverses the string by first providing the quine as the default argument. This beats the syntax error version, which isn't even consistent between browsers.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.