This is the robbers' thread. For the cops' thread, click here.
Cops' Task
For the cops' thread, click here.
Robbers' Task
- Find an uncracked submission on the cops' thread. (A submission may only be cracked once.)
- Unscramble the code to find a working quine.
- Post an answer on the robbers' thread. Include the language, the byte count, the user who posted the scrambled code, a link to that answer, and the unscrambled code.
Here is an example of a robber submission:
Python, 29 bytes, Oliver
_='_=%r;print _%%_';print _%_
Scoring
The user with the most cracks will be the winner of this section.
-
1\$\begingroup\$ What is up with the link?! \$\endgroup\$Solomon Ucko– Solomon Ucko2016年11月11日 21:33:47 +00:00Commented Nov 11, 2016 at 21:33
14 Answers 14
Vim, 22 bytes, Loojvo
qtiqtqx0l"tp^V^[^[qx0l"tp
Explanation:
qt " Start recording in register 'q'
i " Enter insert mode
qtqx0l"tp " Enter this string
^V^[ " Enter a literal 'esc' character
^[ " Exit insert mode
q " Stop recording
At this point, the buffer looks like this:
qtqx0l"tp^[
And the cursor is on the last column (the 'esc' key).
x " Delete the esc character
0l " Move to the second character on this line
"tp " And paste register 't'
Underload, 20 bytes, ais523
(:a~*(*S)):a~*(*S)*S
Explanation
The basic quine in Underload is this:
(:aSS):aSS
Here is how it works:
Stack: Output:
(:aSS) # Push string. (:aSS)
: # Duplicate. (:aSS) (:aSS)
a # Wrap in (...). (:aSS) ((:aSS))
S # Print. (:aSS) (:aSS)
S # Print. (:aSS):aSS
The first issue was to reduce the number of S we need, because we've only got 3 for use here. We can do this by making use of swapping (~) and concatenation (*):
(:a~*S):a~*S
Here, instead of printing twice, we put the (...) version and the plain version of the string together and print that only once.
The bigger puzzle is how print an odd number of * and S. I'm not even sure how I actually arrived at the final solution, but it turns out that we can do this by putting the tail of the output in a separate string. That string itself is duplicated in the first string, but the contents are not, which gives us the extra occurrences of * and S we need. Here is a breakdown of the final solution:
Stack: Output:
(:a~*(*S)) (:a~*(*S))
: (:a~*(*S)) (:a~*(*S))
a (:a~*(*S)) ((:a~*(*S)))
~ ((:a~*(*S))) (:a~*(*S))
* ((:a~*(*S)):a~*(*S))
(*S) ((:a~*(*S)):a~*(*S)) (*S)
* ((:a~*(*S)):a~*(*S)*S)
S (:a~*(*S)):a~*(*S)*S
MATL, 20 bytes, Luis Mendo
'wo&GzL0fk'tl#DwI-ch
I've never used MATL before, so my understanding may be slightly off, but this is basically how it works:
'wo&GzL0fk' This is a string representation of the code, offset by 3
t Creates a duplicate copy of the string
l#D Adds quotes to the second copy
w Swap the unquoted version to the top of the stack
I- Offset the characters in that version by 3
c Convert back to characters
h Join with the quoted string
-
\$\begingroup\$ Impressive! Especially considering this is your first Matlab answer. Well done! \$\endgroup\$Luis Mendo– Luis Mendo2016年11月13日 23:18:12 +00:00Commented Nov 13, 2016 at 23:18
Python 2, 54 bytes, Loojvo
l= ['l=', ';print l[0],`l`,l[1]'] ;print l[0],`l`,l[1]
Had a hard time finding it, as I have basically almost never touched python
Retina, 20 bytes, Martin Ender
\)1S*`\(?
\)1S*`\(?
I found this simply by messing around attempting to create a quine. I found the "shorter quine" that he hinted at first (or a similar one, at least), simply by experimenting (14 bytes):
\)1S*`
\)1S*`
It took me about half an hour to an hour. Very clever, Martin!
-
\$\begingroup\$ Nice job! :) There are about 6 variants of the 14-byte quine, I think. \$\endgroup\$Martin Ender– Martin Ender2016年11月16日 16:40:37 +00:00Commented Nov 16, 2016 at 16:40
-
\$\begingroup\$ @MartinEnder I started by trying to shuffle your anagram around, but that wasn't helping, so I started with the known quine and modified that. \$\endgroup\$mbomb007– mbomb0072016年11月16日 16:42:11 +00:00Commented Nov 16, 2016 at 16:42
-
\$\begingroup\$ @MartinEnder Did you add the new quine to the "Golf you a quine" question? \$\endgroup\$mbomb007– mbomb0072016年11月20日 21:09:31 +00:00Commented Nov 20, 2016 at 21:09
-
\$\begingroup\$ Yes. \$\endgroup\$Martin Ender– Martin Ender2016年11月20日 21:19:17 +00:00Commented Nov 20, 2016 at 21:19
JavaScript ES6, 49 bytes, Mama Fun Roll
function f(){return `${(((((k=>f+'')(f)))))}`}
Pretty much the standard JS function quine, with a little obfuscation.
><>, 36 bytes, Erik the Golfer
'''000**rd3*:::?!;od0.!!+..233??dfrr
I'm quite sure that this is not the intended solution. However,><> quines make it fairly easy to get rid of most unwanted characters, except the '. Fortunately, the : made it quite easy to take care of those as well.
Explanation
''' Push everything except these quotes onto the stack.
000** In effect, pushes a zero.
r Reverse the stack.
d3* Push 39 (the quote character).
:: Make two copies. The stack now holds
a null-terminated representation of the
entire code.
The print loop begins here...
: Duplicate top of stack.
?!; Terminate if zero.
o Otherwise, print.
d0. Jump back to position 13, i.e. the
beginning of the print loop.
!!+..233??dfrr Unused characters.
-
\$\begingroup\$ Yep, not the indended solution :P Well done. \$\endgroup\$Erik the Outgolfer– Erik the Outgolfer2016年11月13日 17:11:50 +00:00Commented Nov 13, 2016 at 17:11
JavaScript, 147 bytes, jrich
+function e(){window[(w=[``>``]+``)[i=9/9]+w[i+i]+"ert"]('+'+e+'()');" +./;;;;;=======>[]````````ccddddddeeeeeeeefiinnnnoooooorrrrrrrsttuwwx{}"}()
With all those extra chars, this is definitely not the intended solution :-)
-
\$\begingroup\$ Yep, definitely not the intended solution, but I'm impressed! Good job! \$\endgroup\$jrich– jrich2016年11月12日 20:07:25 +00:00Commented Nov 12, 2016 at 20:07
-
\$\begingroup\$ @jrich The trickiest part was figuring out how to balance the brackets and parens so that I wasn't using any extra ones. I see you didn't realize that the
(false+"")[1]trick would be useful here? ;) \$\endgroup\$ETHproductions– ETHproductions2016年11月12日 20:11:24 +00:00Commented Nov 12, 2016 at 20:11 -
\$\begingroup\$ Didn't think about it to be honest... my solution was... a little more difficult to say the least \$\endgroup\$jrich– jrich2016年11月12日 20:13:46 +00:00Commented Nov 12, 2016 at 20:13
Haskell, 86 bytes, Laikoni
y!r=r:y:r:[y]>>=id;main=putStr$[succ$'!']!"y!r=r:y:r:[y]>>=id;main=putStr$[succ$'!']!"
Nice idea to get the " via succ$'!' (ascii char after !). There were some missing chars to get them the usual way, i.e. implicitly via show or print.
Befunge, 15 bytes, James Holderness
<:0:+1_@#%9,:g-
Explanation
The catch here is that the loop terminates when the current character is divisible by 9, which is only the case for -. Hence, that needs to go at the end.
< Run code from right to left.
- There will always be 2 zeros on top of the stack at this
point, and this just reduces them to 1 zero.
g Get the character at the coordinates given by the top
two stack values, (0, 0) initially.
,: Print a copy of that character.
%9 Modulo 9.
_@# Terminate if that is 0.
+1 Increment the x coordinate.
: Duplicate it.
:0 Push two zeros.
PHP, 110 bytes, Oliver
<?php $x='<?php $x=0; echo strtr($x, array(chr(39).$x.chr(39)));'; echo strtr($x, array(chr(39).$x.chr(39)));
Thanks, I had fun and the strtr([]) trick was a new one for me that I hope will save me some bytes in the future.
Jelly, 3 bytes, Erik the Golfer
"ṘṘ
There aren't really that many options... (Plus, this is the standard quine.)
Python 2, 105 bytes, Erik the Golfer
a='a=%r;print a%%a ###(((())))**-01::@@@@@[[]]gggiiirrr~';print a%a ###(((())))**-01::@@@@@[[]]gggiiirrr~
It's just the standard Python string formatting quine...
Ruby, 53 bytes, wat
puts <<ENDIT*2,"ENDIT"
puts <<ENDIT*2,"ENDIT"
ENDIT
Just a modification of the standard heredoc quine:
puts <<2*2,2
puts <<2*2,2
2
Explore related questions
See similar questions with these tags.