# The Mystery String Printer (Robbers)

The cops thread can be found here: The Mystery String Printer (Cops)

• Choose a submission from the cops thread, and print out the string from an answer in that thread.
• The submission that you choose must not be safe (it must be newer than 7 days).
• Your program, function, or REPL script needs to follow the same rules as the cops thread. Just to recap:

• Your program must be ≤128 characters (if a cop's submission is in a smaller range of program lengths, your program must also be in that length range. For example, if a cop's program is ≤32 bytes, your program must be ≤32 bytes).
• The program must produce the same output every time it is run.
• No cryptographic functions.
• The program must not take input.
• No standard loopholes.
• All new submissions must use the same language. Submissions from before this rule was made are fine, even if they don't.

## Scoring

Scoring works similarly for robbers, but it is slightly different:

• Cracking any program of ≤8 bytes gives 1 point.
• Cracking a ≤16 byte program gives 2 points. ≤32 bytes gives 4 points, and so on.
• Every additional submission, no matter the length, earns +5 points
• Each cop's submission can only be cracked once- only the first person to crack each submission gets the points.

# Submissions

• A link to the cop's submission.
• Your program and programming language.
• Also have the cop's program length (as a power of 2) as the last number in your header.

Here is a Stack Snippet to generate leaderboards. Please leave a comment if there is a problem with the snippet. If you would like to see all open cop submissions, see the snippet in the cops' challenge.

/* Configuration */

var QUESTION_ID = 60329; // Obtain this from the url
// It will be like http://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";

/* App */

comment_page;

return "//api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function(data) {
data.items.forEach(function(a) {
});
comment_page = 1;
}
});

}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function(data) {
data.items.forEach(function(c) {

});

else process();
}
});
}

var POINTS_REG = /(?:<=|≤|&lt;=)\s?(?:<\/?strong>)?\s?(\d+)/
var POINTS_REG_ALT = /<h\d>.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

function getAuthorName(a) {
return a.owner.display_name;
}

function process() {

var valid = [];
var open = [];

var body = a.body;
var cracked = false;

var points = body.match(POINTS_REG);
if (!points) points = body.match(POINTS_REG_ALT);

if (points) {
var length = parseInt(points[1]);
var crackedpoints = 0;
if (length > 64) crackedpoints = 16;
else if (length > 32) crackedpoints = 8;
else if (length > 16) crackedpoints = 4;
else if (length > 8) crackedpoints = 2;
else crackedpoints = 1;

valid.push({
user: getAuthorName(a),
numberOfSubmissions: 1,
points: crackedpoints

});
}
});

var pointTotals = [];
valid.forEach(function(a) {

var index = -1;
var author = a.user;
pointTotals.forEach(function(p) {
if (p.user == author) index = pointTotals.indexOf(p);
});

if (index == -1) pointTotals.push(a);
else {
pointTotals[index].points += a.points;
pointTotals[index].numberOfSubmissions++;
}

});

pointTotals.forEach(function(a) {
a.points += +((a.numberOfSubmissions - 1) * 5);
});

pointTotals.sort(function(a, b) {
var aB = a.points,
bB = b.points;
return (bB - aB != 0) ? bB - aB : b.numberOfSubmissions - a.numberOfSubmissions;
});

pointTotals.forEach(function(a) {

.replace("{{NAME}}", a.user)
.replace("{{SUBMISSIONS}}", a.numberOfSubmissions)
.replace("{{POINTS}}", a.points);

});

}
body {
text-align: left !important
}
width: 240px;
float: left;
}
#open-list {
width: 450px;
float: left;
}
font-weight: bold;
vertical-align: top;
}
table td {
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<tr>

<td>Author</td>
<td>Submissions</td>
<td>Score</td>
</tr>

</tbody>
</table>
</div>

<table style="display: none">
<tr>
<td>{{NAME}}</td>
<td>{{SUBMISSIONS}}</td>
<td>{{POINTS}}</td>
</tr>
</tbody>
</table>

This contest is now closed.

Overall winner: kennytm

Most submissions: Sp3000

(Note that the amount of submissions doesn't translate exactly to the points, as the length of the cracked program is counted when calculating the score).

• Note: every additional submission earns 5 points – Daniel M. Oct 12 '15 at 20:13

# CoffeeScript, J Atkin, ≤ 16

Math.PI*Math.LN2


Hooray for the inverse symbolic calculator.

• Well, that was fast. – lirtosiast Oct 13 '15 at 2:40
• Ok, that was lame of me to try that ;) – J Atkin Oct 13 '15 at 2:55

# PARI/GP, alephalpha, ≤ 4

9!-9


I don't actually know the language, but that has to be the right answer.

# TI-BASIC, quartata, ≤2

Xmin


On a fresh calculator, the window dimensions are Xmin=Ymin= -10, Xmax=Ymax=10. I actually posted about this in a TI-BASIC golfing tip answer before @quartata posted the cop!

Current consensus is to allow all code to be run on a fresh interpreter. We can take advantage of this—all uninitialized real variables start at 0 in TI-BASIC, and Xmin starts as the possibly useful value -10. So if you ever need to take a running total in a program that doesn't take input from Ans, or you really need a -10 in one less byte, this tip can help you.

There are therefore four solutions: Xmin, Ymin, ZXmin, and ZYmin—the latter are the zoom tokens, which I don't know the exact purpose of.

• I think the zoom tokens represent the screen location after zooming in on a graph... See here. – mbomb007 Oct 16 '15 at 15:19

# LOLCODE, sysreq, ≤ 4

OBTW


Found the intended solution here. :/

• +1 for either research or reading every single post on this site, not sure which – lirtosiast Oct 17 '15 at 2:53

# ><> , randomra, ≤ 8

'ol(?;r>


For some reason, 23 was surprisingly hard to get.

• Nice! My solution was 'l(?;o>x, with non-deterministic run and deterministic output. – randomra Oct 17 '15 at 10:24

# TI-BASIC, Thomas Kwa, ≤ 4

³√(tanh(7°


I don't have any way to test the code, so I'm not completely sure if the notation is correct. The sequence of steps I used to get the output are:

1. Value 7.
2. Convert from degrees to radians.
3. Apply hyperbolic tangent.
4. Apply cube root.

Cracking method:

• I made the assumption that the 4 bytes were one single byte constant, with 3 operators listed as "1 byte token" in the documentation applied to it.
• For the constants, I used the 10 single digit numbers, and pi, giving 11 options.
• For the operators, I picked the ones from the list of one byte tokens that looked like they would make sense in this context, resulting in a list of 26 operators.

This left me with brute forcing 11 * 26 * 26 * 26 possibilities, which a small C++ program completed in milliseconds on my laptop. Listing the smallest differences to the target value, it gave a bunch in the range of 1e-5, and a single one that was about 6e-8, which was close enough to be a solution.

• Something like ʳ? – Dennis Oct 17 '15 at 20:40
• @ThomasKwa I multiplied by (pi/180). Reading the documentation again, I guess it makes sense that it would be the other operator. Because that one says "you can have the angle evaluated as if in degree mode". – Reto Koradi Oct 17 '15 at 20:47
• Did you brute-force, or solve this manually? – lirtosiast Oct 17 '15 at 20:51
• @ThomasKwa I mostly let my computer solve it. ;) I'll add some explanation. – Reto Koradi Oct 17 '15 at 20:52

# gs2, quartata, Range: <= 8

\x01\x02\x01\x07/e\x81e


The number is simply 2^5040 (i.e., 2 raised to the power of 7 factorial). Factorizing it was the easy part. Finding out how to work gs2 took a lot longer.

The workings of the program are described below (using \xNN notation to represent non-ASCII bytes):

\x01\x02                   Push the number 2 onto the stack
\x01\x07           Push the number 7 onto the stack
/          Change this into a list [1,2,3,4,5,6,7]
e         Multiply everything in this list (5040)
\x81     Make a list containing [2,2,2...] 5040 times
e    Multiply everything together again


This leaves the number 27! on the stack, which is printed when the program exits.

# AppleScript, VTCAKAVSMoACE, ≤16

{1=1,1=0}>0


Needs 5 more bytes to redirect to stdout, so total size is exactly 16 bytes.

• Well done! :D I was mildly hopeful that no one would recognize that the > character would throw that specific error, and try to use as integer or the like. – Addison Crump Oct 18 '15 at 17:32

# JavaScript, histocrat, ≤ 32

Well, this was lucky. I needed exactly 32 bytes:

[...'aa0abaabaa4abaaaa6abaa']+''


How this works:

• the brand new spread-operator* creates an array from a string
• + '' forces the array to be casted to string, which implies a concatenation by , in JavaScript
• the result of the expression is printed onto the console

So basically it's a shorter version of:

'aa0abaabaa4abaaaa6abaa'.split('').join()


* The spread-operator is a new Array Initializer in ECMAScript 2015 (ES6) standard. Works currently in Chrome and Firefox.

• Ha, had no idea javascript had a splat now. – histocrat Oct 19 '15 at 13:10

# TI-BASIC, quartata, <=7

πE8/e


I found this using RIES.

• It seems like REIS will prevent most simple math ops, which I can't say is such a bad thing. – Daniel M. Oct 11 '15 at 4:04
• Did not know about RIES. Definitely won't be doing any number ones then :P – a spaghetto Oct 11 '15 at 4:14

# Math++, SuperJedi224, ≤8 bytes

cbrt7835


I used the Inverse Symbolic Calculator.

• Yeah, that's right. – SuperJedi224 Oct 11 '15 at 16:41

# Python, Status, ≤128 bytes

print"NEENER"*3# This code outputs the following string: "NEENERNEENERNEENER". This is achieved by evaluating "NEENER" * 3.


'~$q  It took me a while to find the ' instruction... # bc -l, NaN, <=8 l(4.76)  Derived from a rather longer solution found using ISC. # TI-89 BASIC, @DankMemes, <=8 236!  The string of zeroes at the end gave it away. # Python, Zach Gates, ≤ 64 s='UCAG' print(" ".join(x+y+z for x in s for y in s for z in s))  Behold the ton of other attempts: # Python 3 only from itertools import* print(*map("".join,product(*["UCAG"]*3))) # Python 2 only def f(s): if s[2:]:print s, else:for x in"UCAG":f(s+x) f("") # Too long o="" for n in range(64):exec("o+='UCAG'[n%4];n//=4;"*3);o+=" " print(o) # Too long L=[""] exec("L=[x+y for x in L for y in'UCAG'];"*3) print(" ".join(L))  # ><>, Cole, ≤ 8 'l?!;}n!  Pretty obvious when the code points in the output give basically all the chars. • Didn't have time to comment on this earlier but I'm still pretty impressed at how fast you got that. I wasn't sure if errors were allowed, but I considered putting * in stead of }; would that have been any harder? Ah well, guess I'll have to take a look at your submission. – cole Oct 13 '15 at 2:15 • @Cole * would indeed have been harder, but I'm not sure about the error thing either... – Sp3000 Oct 13 '15 at 2:20 # PowerShell, TimmyD, ≤2 $?


I looked at this page of commands and found two that seemed like they would print true.

# Javascript ES6 REPL, pandorym, ≤16

6496/9090+"323"


# QBasic, DLosc, <=32

FOR c=1TO 8
?TAB(c*c);c;
NEXT


The answer was so trivial, it was converted to a comment.

TAB can be used in a PRINT (shortcut ?) statement to set the cursor position.

• Looks good now! (Also, not my original code, by the way--in fact, yours is 2 bytes shorter.) – DLosc Oct 13 '15 at 20:49

# JavaScript, Cᴏɴᴏʀ O'Bʀɪᴇɴ, ≤16 bytes

You could just enter the number in hexadecimal at the console like this:

0x6ffffffffffffe


This is one byte shorter:

s=1<<26;s*s*7-2


(In other languages, (7<<52)-2 would have worked fine, but not Javascript.)

• Not the exact same one I had in mind. – Conor O'Brien Oct 14 '15 at 1:41
• @CᴏɴᴏʀO'Bʀɪᴇɴ but he produced the string. Was it 7*Math.pow(2,52)? – Sven Writes Code Oct 14 '15 at 13:08

# Javascript, user2428118, <= 16

Math.PI*9e9

Thanks to Sven the Surfer for the help.

I used ISC which was used to crack one of my answers.

### VBA, JimmyJazzx, ≤32

Sub a()
MsgBox -2^31+23
End Sub


I think; I can't actually get it to stay like this since the VBA editor reformats and adds spaces between the math operators ... but typing that in works and doesn't error...

• Yep. Not exactly what I had, But works just as well. VBA editor is a pain for spaces.And for most of the golfing counts its acceptable to remove unnecessary spaces from VBA. as long as when you copy paste it works. Good job! knew someone would out math me quite quickly, but with 10 bytes to play with your limited – JimmyJazzx Oct 15 '15 at 11:30

# Lua, Egor Skriptunoff, ≤ 32

_='()()()'print(_:gsub(_,_.rep))

• Welcome to PPCG! You should also ensure to add a comment on Egor's answer linking back to this post, so that Egor is aware you potentially cracked the solution. – AdmBorkBork Oct 15 '15 at 13:03

# CJam, Dennis, ≤ 4

P2mh


Glorious inverse symboli... shot

• It was also the only Google search result, but I was too slow trying to figure out how to CJam. Well done. – Sven Writes Code Oct 17 '15 at 23:59

# Pip, DLosc, ≤ 4

mTB3


The value is 1000 in base 3.

This one was easy to crack manually. The most obvious guess was that it was a number converted to binary. But that number would have been 105, which has no nice shortcut, and would result in 5 bytes of code. The next attempt was to try base 3 instead of base 2, and bingo!

# Javascript (ES6, console), Shaun H, <= 64

[...[].pop+''].sort().map(x=>x.charCodeAt()+'').join('')


At first I thought I could get the Chrome string short enough with just hex literals, but then I realized what the code must have been doing.

Anyway, the main hint was that native functions have slightly different string representations in Chrome vs FF.

# J, Mauris, <=4

%!7


This wasn't difficult. 0.000198413 = 1/5040 = 1/(7!)

# J, Dennis, <=4

8!^5


How I found it:

• assumed f ? ? ? format and inverted one-variable one-letter verbs (f) with no success
• assumed x f g y format and checked fg == !! with (!!)"0/~i.10 then fg == !^ with (!^)"0/~i.10 which contained the desired output (4.81845e12) for 8!^5

# Mathematica, Eridan, ≤64

IntegerString[18612512719586442658197,2]