Golfscript, 33 characters
""~.{'""~.'print tnirp'.~""'}.~""
Since every language uses parentheses of some form, I assert the "(
mirrors to (
" version of this challenge is impossible (under rule #2), and assume (
mirrors to )
. Additionally, this version provides more visual symmetry.
If trailing whitespace is allowed, empty strings can be replaced with newlines (29 characters):
n~.{'n~.'print tnirp'.~n'}.~n
Proceeds as follows:
""~.
pushes an empty string onto the stack, evaluates it and clones the input (empty string)
{...}
is a block
.~""
clones the block, evaluates one copy and pushes an empty string to the stack.
That block:
'""~.'
pushes the string ""~.
onto the stack
print
outputs it directly and removes it from the stack
tnirp
is an undefined symbol and does nothing
'.~""'
pushes the string .~""
onto the stack
After the program finishes, the stack contents are printed:
- the empty string (twice)
- the main block, including delimiters
- the program suffix as a string
- another empty string
2The name "mirror quine" is confusing. It sounds like a program that outputs the reverse of its source (itself an interesting challenge perhaps). Yours is a palindromic quine. – Timwi – 2015-12-16T05:28:24.793
Maybe you also want to exclude the form code+comment char+reverse code. – Howard – 2013-10-18T06:18:19.860
@Howard yes, thanks for pointing this out.. – Coding man – 2013-10-18T06:32:40.930
does
(
mirror as(
, or as)
(and similarly for other brackets)? If it's the former, then I think it disqualifies any potential solution. Even golfscripters need blocks. – John Dvorak – 2013-10-18T06:43:51.183@Howard what you suggest? or lets wait for atleast a single possible solution :P – Coding man – 2013-10-18T06:47:09.887
or lets wait for at least a single possible solution considering "(" mirrors as "(" (and similarly for other brackets) and also exclude the form code+comment char+reverse code – Coding man – 2013-10-18T06:55:42.667
@Codingman My Befunge program does exactly that – Justin – 2013-12-11T23:34:26.890
For anyone looking for the non-closed, clearly specified version of this challenge, it's here. Unfortunately, I can't re-close as duplicate without moderator intervention, and a comment works almost as well as getting the moderators would.
– None – 2017-06-02T15:09:19.550