83
\$\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

66 Answers 66

0
\$\begingroup\$

Stax, 14 bytes

"r34b4l"r34b4l

Run and debug it

Yet another adaption of the "34bL"34bL quine.

\$\endgroup\$
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\$

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\$
0
\$\begingroup\$

MS SQL Server 2017, 173 bytes

declare @ char=1
select
reverse(substring(left(@+replicate('+char(39),3),201),28,174))
declare @ char=1
select
reverse(substring(left(@+replicate('+char(39),3),201),28,174))

Output:

))471,82,)102,)3,)93(rahc+'(etacilper+@(tfel(gnirtsbus(esrever
tceles
1=rahc @ eralced
))471,82,)102,)3,)93(rahc+'(etacilper+@(tfel(gnirtsbus(esrever
tceles
1=rahc @ eralced

Try it on db<>fiddle!

\$\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.