Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite:

  • If your program is run normally, all of the code not in the speech marks (" - double quotes) should be printed.
  • If your program is wrapped in double quotes (in turn inverting the speech marks), the code that is normally n̶o̶t̶ in quotes should be printed.


Let's say you have the following code:

fancyStuff("myCode"); "I like".isGreat();

If I run it, I would expect an output of:


However, if I wrapped it in quotes, I would get:

"fancyStuff("myCode"); "I like".isGreat();"

When this code is run, the expected output would be:

I like

Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.


  • Standard loopholes apply.
  • The printed values, in both quoted and unquoted forms, must be non-empty, or consist solely of whitespace. This also means that all programs must include at least one set of quotes.
  • However, trailing/preceeding whitespace is allowed.
  • The quoted and unquoted strings must print different results.
  • No looking at your own code, required file names, etc.
  • Unmatched quotes are disallowed
  • If there are multiple strings, they can either be printed as newlines (as in the example), or in some other human-readable way - no arrays or objects
  • This is , so shortest answer in bytes wins.
  • \$\begingroup\$ So, if i understand correctly, any answers in that question which print the same string for both raw and wrapped source is also valid to this one. \$\endgroup\$ – tsh Jun 22 '19 at 12:16
  • \$\begingroup\$ @tsh technically correct, but I should probably add a rule against that... \$\endgroup\$ – Geza Kerecsenyi Jun 22 '19 at 12:19

Python 2, 32 bytes


Try it online!

Based on my initial solution for the other variant of this puzzle.

| improve this answer | |

><>, 39 16 bytes


Try it online! (quoted)


"l2*0.|or|["     Pushes the quoted characters onto the stack
            0    Pushes 0
             90. Goes to A
          [      Wipes the stack (requires the 0)
"          "090. Pushes the quoted characters onto the stack
 l2*0.           Length is 4; goes to B
      |or|       Reverses & prints the stack
A        B
""                 No-op
  l2*0.            Length is 0; goes to A
 "l2*0.|or|["      Pushes the quoted characters onto the stack
             0     Pushes 0
              90.  Goes to B
       |or|        Reverses & prints the stack

Old answer, 39 bytes


Try it online! (quoted)

Whew, this took a while. Can probably be golfed further.

"!~l?!<r&[orl&"                         Pushes the quoted characters onto the stack
               0[                       Wipes the stack
                 c2*&                   Puts 24 into the register (&)
                     d0.                Goes to A
"             "0[c2*&d0.>o<~~.!?@@0+1fl Pushes the quoted characters onto the stack
 !~l?!<                                 No-op (in this case)
       r                                Reverses the stack
        &[                              Wipes the stack, preserving the top &
          o                             Outputs the top character on the stack
           r                            Reverses the stack
            l&                          Puts the current length of the stack into the register
                                        Repeats until &=0, then errors
""!~                                      No-op
    l?!<                                  Reverses the IP direction
""!~l?!                                 " No-op
                            ~~.!?@@0+1fl  If the length is 0, go to B
""!~l?!<r&[orl&"                        " Pushes the quoted characters onto the stack (backwards)
                            ~~.!>@@0+1fl  No-op (length != 0)
                         >o<              Outputs all the characters on the stack, then errors

(Note: when I "wipe" the stack, it really creates a new stack; the old stack is still there and accessible)

| improve this answer | |

05AB1E (legacy), 5 bytes


Outputs concatenated without separator.

Try it online or try it online with surrounding quotes.


         # Program without surrounding quotes will output string "··"
·        # Double the top of the stack, which is empty, so an empty string is pushed
 "·"     # Push string "·" to the stack
    ·    # Double it (2*). Since the legacy version is built in Python, the string is
         # concatenated with itself: "··"
         # (output the top of the stack implicitly as result)

         # Program with surrounding quotes will output string "·"
"·"      # Push string "·" to the stack
   ·     # Double it to string "··"
    "·"  # Push string "·" to the stack
         # (output the top of the stack implicitly as result)
| improve this answer | |

Gol><>, 9 bytes

 `H"H` "H

Try it online! Quoted version.

| improve this answer | |

><>, 17 bytes


Try it unquoted! Quoted!

| improve this answer | |

Runic Enchantments, 11 bytes


Try it online! and "!"!""!$;"$;"

Just a one-byte 'inversion' of the prior answer (and 1 byte for having to include the inverting-byte as part of a string literal as well).


Note that . is a NOP command and used as a spacer where other commands are not executed or otherwise removed for explanatory purposes.

!" is effectively NOP, resulting in the execution of only ...."!$;"$; which prints the contents of the code not contained between quote-pairs (!........$;)

Wrapping everything in quotes causes the first !" to be string literal, resulting in "!".."!$;"$;. and which prints the parts of the program contained within quote-pairs ("!" and "!$;").

| improve this answer | |

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.