Inverse-quotes-quineASCII's 95 Characters…95 Movie QuotesA Quine on Every LineDouble-duty quine: quine!dlroW ,olleHMake an interweaving quineFastest Mini-Flak QuinePeriod 2 Reversed QuineInvert a Quine!Write a Quine SuiteThe Great Pyramid of QuinePrint the total length of all “quoted” characters
Accidentals and ties
Mean value theorem inequality problem.
What was the Shuttle Carrier Aircraft escape tunnel?
Would it be a copyright violation if I made a character’s full name refer to a song?
Should I prioritize my 401(k) over my student loans?
Unusual mail headers, evidence of an attempted attack. Have I been pwned?
Why change the size when print a object
How does Powershell create fake drive labels in Windows?
How is hair tissue mineral analysis performed?
Why doesn't a marching band have strings?
How to create a Tetrix/Sierpinski Tetrahedron fractal radiating from 0,0,0 ? Python or nodes
How much will studying magic in an academy cost?
How was Hillel permitted to go to the skylight to hear the shiur
How do I turn off a repeating trade?
Find the diameter of a word graph
Why is the high-pass filter result in a discrete wavelet transform (DWT) downsampled?
Hand soldering SMD 1206 components
3D Crossword, Cryptic, Statue View & Maze
Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?
Trainee keeps missing deadlines for independent learning
Does Marvel have an equivalent of the Green Lantern?
Is this one of the engines from the 9/11 aircraft?
What is the origin of Scooby-Doo's name?
Wifi dongle speed is slower than advertised
Inverse-quotes-quine
ASCII's 95 Characters…95 Movie QuotesA Quine on Every LineDouble-duty quine: quine!dlroW ,olleHMake an interweaving quineFastest Mini-Flak QuinePeriod 2 Reversed QuineInvert a Quine!Write a Quine SuiteThe Great Pyramid of QuinePrint the total length of all “quoted” characters
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
The prospect of this challenge is:
- If your program is run normally, all of the code 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 not in quotes should be printed.
E.g:
Let's say you have the following code:
fancyStuff("myCode"); "I like".isGreat();
If I run it, I would expect an output of:
myCode
I like
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:
fancyStuff(
);
.isGreat();
Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.
Rules
- 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.
- 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 code-golf, so shortest answer in bytes wins.
code-golf restricted-source quine
$endgroup$
|
show 8 more comments
$begingroup$
The prospect of this challenge is:
- If your program is run normally, all of the code 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 not in quotes should be printed.
E.g:
Let's say you have the following code:
fancyStuff("myCode"); "I like".isGreat();
If I run it, I would expect an output of:
myCode
I like
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:
fancyStuff(
);
.isGreat();
Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.
Rules
- 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.
- 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 code-golf, so shortest answer in bytes wins.
code-golf restricted-source quine
$endgroup$
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
2
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
3
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
3
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago
|
show 8 more comments
$begingroup$
The prospect of this challenge is:
- If your program is run normally, all of the code 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 not in quotes should be printed.
E.g:
Let's say you have the following code:
fancyStuff("myCode"); "I like".isGreat();
If I run it, I would expect an output of:
myCode
I like
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:
fancyStuff(
);
.isGreat();
Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.
Rules
- 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.
- 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 code-golf, so shortest answer in bytes wins.
code-golf restricted-source quine
$endgroup$
The prospect of this challenge is:
- If your program is run normally, all of the code 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 not in quotes should be printed.
E.g:
Let's say you have the following code:
fancyStuff("myCode"); "I like".isGreat();
If I run it, I would expect an output of:
myCode
I like
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:
fancyStuff(
);
.isGreat();
Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.
Rules
- 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.
- 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 code-golf, so shortest answer in bytes wins.
code-golf restricted-source quine
code-golf restricted-source quine
edited 9 hours ago
Geza Kerecsenyi
asked 10 hours ago
Geza KerecsenyiGeza Kerecsenyi
3672 silver badges14 bronze badges
3672 silver badges14 bronze badges
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
2
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
3
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
3
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago
|
show 8 more comments
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
2
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
3
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
3
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
2
2
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
3
3
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
3
3
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago
|
show 8 more comments
5 Answers
5
active
oldest
votes
$begingroup$
Python 2, 27 bytes
'';print";print 2*"'';print
Try it online!
Train of thought behind this answer:
Begin with a simple print, because we need to print something.
print"a"
We also need to print something in the inverted case, ie. have a print inside quotes.
print"print"
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string print
, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
print";print"
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the print
at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append print
and multiply the last string by 2.
print";print 2*"print
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
;print";print 2*";print
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow print";print 2*"
in the non-inverted code without breaking anything. We can use ''
, which simply gets concatenated with the prior string.
'';print";print 2*"'';print
$endgroup$
add a comment |
$begingroup$
05AB1E, 4 bytes
"A"§
Outputs concatenated without separator.
Try it online or try it online with surrounding quotes.
Explanation:
# Program without surrounding quotes will output string "A"
"A" # Push "A" to the stack
§ # Cast it to a string
# (output the top of the stack implicitly as result)
# Program with surrounding quotes will output string "§"
"" # Push an empty string to the stack
A # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
"§" # Push "§" to the stack
# (output the top of the stack implicitly as result)
$endgroup$
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
add a comment |
$begingroup$
Runic Enchantments, 9 bytes
"!""$;"$;
Try it online! and ""!""$;"$;"
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
7 bytes
0".""$;
Try it online! and "0".""$;"
Under normal circumstances, this program executes as 0".""$;0".""$;
pushing an integer 0
, then the string .
, concatenates $;0
, NOP, concatenates an empty string, prints top-of-stack (the string .$;0
) and terminates. Wrapping it in quotes produces "0".""$;"
which pushes a string-0
, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer 0
in string form). The last "
is left unexecuted (and not part of the original program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the "
itself).
$endgroup$
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the$;
at the end in the quoted version.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g"$;
and""$;"
(Runic wrap-around quotes pairing with themselves).
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output!.
(which is correct), but shouldn't your program with quotes output0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be0"!""$;"$;
(which outputs!$;
as is, or outputs0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the0
and output!$;
and$;
.
$endgroup$
– Kevin Cruijssen
9 hours ago
1
$begingroup$
@KevinCruijssen$
is "print top of stack" and;
terminates. But you essentially got a valid answer.
$endgroup$
– Draco18s
8 hours ago
|
show 3 more comments
$begingroup$
Japt, 4 bytes
Unquoted:
"P"s
Try it
Quoted:
""P"s"
Try it
P
is the Japt variable for the empty string and the s
method slices a string - without any arguments, it does nothing.
$endgroup$
add a comment |
$begingroup$
Perl 6, 11 bytes
say ".say~"
Try it online!
Prints .say~
with a trailing newline. Seems too easy. Am I missing something?
When wrapped in quotes, produces say
with a space and trailing newline.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "200"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187163%2finverse-quotes-quine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Python 2, 27 bytes
'';print";print 2*"'';print
Try it online!
Train of thought behind this answer:
Begin with a simple print, because we need to print something.
print"a"
We also need to print something in the inverted case, ie. have a print inside quotes.
print"print"
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string print
, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
print";print"
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the print
at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append print
and multiply the last string by 2.
print";print 2*"print
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
;print";print 2*";print
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow print";print 2*"
in the non-inverted code without breaking anything. We can use ''
, which simply gets concatenated with the prior string.
'';print";print 2*"'';print
$endgroup$
add a comment |
$begingroup$
Python 2, 27 bytes
'';print";print 2*"'';print
Try it online!
Train of thought behind this answer:
Begin with a simple print, because we need to print something.
print"a"
We also need to print something in the inverted case, ie. have a print inside quotes.
print"print"
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string print
, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
print";print"
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the print
at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append print
and multiply the last string by 2.
print";print 2*"print
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
;print";print 2*";print
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow print";print 2*"
in the non-inverted code without breaking anything. We can use ''
, which simply gets concatenated with the prior string.
'';print";print 2*"'';print
$endgroup$
add a comment |
$begingroup$
Python 2, 27 bytes
'';print";print 2*"'';print
Try it online!
Train of thought behind this answer:
Begin with a simple print, because we need to print something.
print"a"
We also need to print something in the inverted case, ie. have a print inside quotes.
print"print"
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string print
, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
print";print"
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the print
at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append print
and multiply the last string by 2.
print";print 2*"print
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
;print";print 2*";print
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow print";print 2*"
in the non-inverted code without breaking anything. We can use ''
, which simply gets concatenated with the prior string.
'';print";print 2*"'';print
$endgroup$
Python 2, 27 bytes
'';print";print 2*"'';print
Try it online!
Train of thought behind this answer:
Begin with a simple print, because we need to print something.
print"a"
We also need to print something in the inverted case, ie. have a print inside quotes.
print"print"
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string print
, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
print";print"
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the print
at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append print
and multiply the last string by 2.
print";print 2*"print
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
;print";print 2*";print
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow print";print 2*"
in the non-inverted code without breaking anything. We can use ''
, which simply gets concatenated with the prior string.
'';print";print 2*"'';print
edited 8 hours ago
answered 9 hours ago
negative sevennegative seven
2111 silver badge5 bronze badges
2111 silver badge5 bronze badges
add a comment |
add a comment |
$begingroup$
05AB1E, 4 bytes
"A"§
Outputs concatenated without separator.
Try it online or try it online with surrounding quotes.
Explanation:
# Program without surrounding quotes will output string "A"
"A" # Push "A" to the stack
§ # Cast it to a string
# (output the top of the stack implicitly as result)
# Program with surrounding quotes will output string "§"
"" # Push an empty string to the stack
A # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
"§" # Push "§" to the stack
# (output the top of the stack implicitly as result)
$endgroup$
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
add a comment |
$begingroup$
05AB1E, 4 bytes
"A"§
Outputs concatenated without separator.
Try it online or try it online with surrounding quotes.
Explanation:
# Program without surrounding quotes will output string "A"
"A" # Push "A" to the stack
§ # Cast it to a string
# (output the top of the stack implicitly as result)
# Program with surrounding quotes will output string "§"
"" # Push an empty string to the stack
A # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
"§" # Push "§" to the stack
# (output the top of the stack implicitly as result)
$endgroup$
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
add a comment |
$begingroup$
05AB1E, 4 bytes
"A"§
Outputs concatenated without separator.
Try it online or try it online with surrounding quotes.
Explanation:
# Program without surrounding quotes will output string "A"
"A" # Push "A" to the stack
§ # Cast it to a string
# (output the top of the stack implicitly as result)
# Program with surrounding quotes will output string "§"
"" # Push an empty string to the stack
A # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
"§" # Push "§" to the stack
# (output the top of the stack implicitly as result)
$endgroup$
05AB1E, 4 bytes
"A"§
Outputs concatenated without separator.
Try it online or try it online with surrounding quotes.
Explanation:
# Program without surrounding quotes will output string "A"
"A" # Push "A" to the stack
§ # Cast it to a string
# (output the top of the stack implicitly as result)
# Program with surrounding quotes will output string "§"
"" # Push an empty string to the stack
A # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
"§" # Push "§" to the stack
# (output the top of the stack implicitly as result)
edited 9 hours ago
answered 9 hours ago
Kevin CruijssenKevin Cruijssen
46.3k5 gold badges79 silver badges233 bronze badges
46.3k5 gold badges79 silver badges233 bronze badges
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
add a comment |
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
Unfortunately, this violates rule #2. While it is fine to have some empty quotes in your code, there must be at least one non-empty one in both surrounded and unsurrounded forms.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
$begingroup$
@GezaKerecsenyi Oops, read past the part "in both quoted and unquoted forms". Should be fixed now.
$endgroup$
– Kevin Cruijssen
9 hours ago
add a comment |
$begingroup$
Runic Enchantments, 9 bytes
"!""$;"$;
Try it online! and ""!""$;"$;"
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
7 bytes
0".""$;
Try it online! and "0".""$;"
Under normal circumstances, this program executes as 0".""$;0".""$;
pushing an integer 0
, then the string .
, concatenates $;0
, NOP, concatenates an empty string, prints top-of-stack (the string .$;0
) and terminates. Wrapping it in quotes produces "0".""$;"
which pushes a string-0
, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer 0
in string form). The last "
is left unexecuted (and not part of the original program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the "
itself).
$endgroup$
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the$;
at the end in the quoted version.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g"$;
and""$;"
(Runic wrap-around quotes pairing with themselves).
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output!.
(which is correct), but shouldn't your program with quotes output0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be0"!""$;"$;
(which outputs!$;
as is, or outputs0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the0
and output!$;
and$;
.
$endgroup$
– Kevin Cruijssen
9 hours ago
1
$begingroup$
@KevinCruijssen$
is "print top of stack" and;
terminates. But you essentially got a valid answer.
$endgroup$
– Draco18s
8 hours ago
|
show 3 more comments
$begingroup$
Runic Enchantments, 9 bytes
"!""$;"$;
Try it online! and ""!""$;"$;"
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
7 bytes
0".""$;
Try it online! and "0".""$;"
Under normal circumstances, this program executes as 0".""$;0".""$;
pushing an integer 0
, then the string .
, concatenates $;0
, NOP, concatenates an empty string, prints top-of-stack (the string .$;0
) and terminates. Wrapping it in quotes produces "0".""$;"
which pushes a string-0
, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer 0
in string form). The last "
is left unexecuted (and not part of the original program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the "
itself).
$endgroup$
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the$;
at the end in the quoted version.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g"$;
and""$;"
(Runic wrap-around quotes pairing with themselves).
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output!.
(which is correct), but shouldn't your program with quotes output0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be0"!""$;"$;
(which outputs!$;
as is, or outputs0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the0
and output!$;
and$;
.
$endgroup$
– Kevin Cruijssen
9 hours ago
1
$begingroup$
@KevinCruijssen$
is "print top of stack" and;
terminates. But you essentially got a valid answer.
$endgroup$
– Draco18s
8 hours ago
|
show 3 more comments
$begingroup$
Runic Enchantments, 9 bytes
"!""$;"$;
Try it online! and ""!""$;"$;"
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
7 bytes
0".""$;
Try it online! and "0".""$;"
Under normal circumstances, this program executes as 0".""$;0".""$;
pushing an integer 0
, then the string .
, concatenates $;0
, NOP, concatenates an empty string, prints top-of-stack (the string .$;0
) and terminates. Wrapping it in quotes produces "0".""$;"
which pushes a string-0
, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer 0
in string form). The last "
is left unexecuted (and not part of the original program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the "
itself).
$endgroup$
Runic Enchantments, 9 bytes
"!""$;"$;
Try it online! and ""!""$;"$;"
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
7 bytes
0".""$;
Try it online! and "0".""$;"
Under normal circumstances, this program executes as 0".""$;0".""$;
pushing an integer 0
, then the string .
, concatenates $;0
, NOP, concatenates an empty string, prints top-of-stack (the string .$;0
) and terminates. Wrapping it in quotes produces "0".""$;"
which pushes a string-0
, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer 0
in string form). The last "
is left unexecuted (and not part of the original program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the "
itself).
edited 8 hours ago
answered 9 hours ago
Draco18sDraco18s
1,6026 silver badges19 bronze badges
1,6026 silver badges19 bronze badges
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the$;
at the end in the quoted version.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g"$;
and""$;"
(Runic wrap-around quotes pairing with themselves).
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output!.
(which is correct), but shouldn't your program with quotes output0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be0"!""$;"$;
(which outputs!$;
as is, or outputs0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the0
and output!$;
and$;
.
$endgroup$
– Kevin Cruijssen
9 hours ago
1
$begingroup$
@KevinCruijssen$
is "print top of stack" and;
terminates. But you essentially got a valid answer.
$endgroup$
– Draco18s
8 hours ago
|
show 3 more comments
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the$;
at the end in the quoted version.
$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g"$;
and""$;"
(Runic wrap-around quotes pairing with themselves).
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output!.
(which is correct), but shouldn't your program with quotes output0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be0"!""$;"$;
(which outputs!$;
as is, or outputs0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the0
and output!$;
and$;
.
$endgroup$
– Kevin Cruijssen
9 hours ago
1
$begingroup$
@KevinCruijssen$
is "print top of stack" and;
terminates. But you essentially got a valid answer.
$endgroup$
– Draco18s
8 hours ago
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the
$;
at the end in the quoted version.$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
Super quick answer! I'm just wondering if I misunderstood something about your submission, but for me it doesn't print the
$;
at the end in the quoted version.$endgroup$
– Geza Kerecsenyi
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g
"$;
and ""$;"
(Runic wrap-around quotes pairing with themselves).$endgroup$
– Draco18s
9 hours ago
$begingroup$
I realized that upon re-reading and am trying to puzzle out if runic can ever execute that bit. Starting to investigate "unpaired" quotes now; e.g
"$;
and ""$;"
(Runic wrap-around quotes pairing with themselves).$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
@GezaKerecsenyi Let me know if my updated program violates any rules.
$endgroup$
– Draco18s
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output
!.
(which is correct), but shouldn't your program with quotes output 0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be 0"!""$;"$;
(which outputs !$;
as is, or outputs 0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the 0
and output !$;
and $;
.$endgroup$
– Kevin Cruijssen
9 hours ago
$begingroup$
Umm.. How is this valid? Your program without quotes output
!.
(which is correct), but shouldn't your program with quotes output 0$;
? PS: I don't know Runic Enchantments at all, but a potential fix based on your current layout which I think is valid would be 0"!""$;"$;
(which outputs !$;
as is, or outputs 0$;
if surrounded with quotes). EDIT: Actually, I think you can drop the 0
and output !$;
and $;
.$endgroup$
– Kevin Cruijssen
9 hours ago
1
1
$begingroup$
@KevinCruijssen
$
is "print top of stack" and ;
terminates. But you essentially got a valid answer.$endgroup$
– Draco18s
8 hours ago
$begingroup$
@KevinCruijssen
$
is "print top of stack" and ;
terminates. But you essentially got a valid answer.$endgroup$
– Draco18s
8 hours ago
|
show 3 more comments
$begingroup$
Japt, 4 bytes
Unquoted:
"P"s
Try it
Quoted:
""P"s"
Try it
P
is the Japt variable for the empty string and the s
method slices a string - without any arguments, it does nothing.
$endgroup$
add a comment |
$begingroup$
Japt, 4 bytes
Unquoted:
"P"s
Try it
Quoted:
""P"s"
Try it
P
is the Japt variable for the empty string and the s
method slices a string - without any arguments, it does nothing.
$endgroup$
add a comment |
$begingroup$
Japt, 4 bytes
Unquoted:
"P"s
Try it
Quoted:
""P"s"
Try it
P
is the Japt variable for the empty string and the s
method slices a string - without any arguments, it does nothing.
$endgroup$
Japt, 4 bytes
Unquoted:
"P"s
Try it
Quoted:
""P"s"
Try it
P
is the Japt variable for the empty string and the s
method slices a string - without any arguments, it does nothing.
answered 6 hours ago
ShaggyShaggy
19.9k3 gold badges19 silver badges68 bronze badges
19.9k3 gold badges19 silver badges68 bronze badges
add a comment |
add a comment |
$begingroup$
Perl 6, 11 bytes
say ".say~"
Try it online!
Prints .say~
with a trailing newline. Seems too easy. Am I missing something?
When wrapped in quotes, produces say
with a space and trailing newline.
$endgroup$
add a comment |
$begingroup$
Perl 6, 11 bytes
say ".say~"
Try it online!
Prints .say~
with a trailing newline. Seems too easy. Am I missing something?
When wrapped in quotes, produces say
with a space and trailing newline.
$endgroup$
add a comment |
$begingroup$
Perl 6, 11 bytes
say ".say~"
Try it online!
Prints .say~
with a trailing newline. Seems too easy. Am I missing something?
When wrapped in quotes, produces say
with a space and trailing newline.
$endgroup$
Perl 6, 11 bytes
say ".say~"
Try it online!
Prints .say~
with a trailing newline. Seems too easy. Am I missing something?
When wrapped in quotes, produces say
with a space and trailing newline.
answered 45 mins ago
Jo KingJo King
29k3 gold badges69 silver badges134 bronze badges
29k3 gold badges69 silver badges134 bronze badges
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187163%2finverse-quotes-quine%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Are unmatched quotes allowed, and if so, how should they be handled?
$endgroup$
– negative seven
10 hours ago
$begingroup$
Must the output be split with newlines like in the examples?
$endgroup$
– Erik the Outgolfer
10 hours ago
2
$begingroup$
@GezaKerecsenyi So, is a separator required, or can we simply concatenate the strings?
$endgroup$
– Erik the Outgolfer
9 hours ago
3
$begingroup$
How is an array not a human readable format?
$endgroup$
– Sriotchilism O'Zaic
5 hours ago
3
$begingroup$
Must strings be output in the same order they appear in our code?
$endgroup$
– Shaggy
4 hours ago