PPCG Jeopardy: Cops

45

4

How well do you know the site? Let's find out.

This is a challenge. Robber's thread.

As a cop, you need to:

  1. Find a non-deleted, non-closed challenge on this site to answer. The challenge cannot have the following tags: , , , , , , , . The challenge must have restrictions on valid output.
  2. Write a valid submission for the challenge, in a free language found on Wikipedia or esolangs.org or tryitonline. The submission does not have to be competitive, only valid. EDIT: Hashing in your submission is not allowed
  3. Post the submission here, keeping the challenge secret. You must post the entire submission, as well as the language (and version, if applicable).

After a week, if nobody has found the challenge you are answering, you may post the challenge that your submission is answering, at which point, your submission is safe. It is worth N points, where N is the number of upvotes on the challenge (as of 2016-11-17) (Higher is better)

To crack your challenge, a robbers need to find any challenge that the submission is a valid submission for.

Notes:

  • If a challenge requires an output of X, and you output XY or YX where Y is anything besides whitespace, the submission is not valid for that challenge.
  • A challenge newer than 2016-11-17 is not allowed.
  • Languages newer than the hidden challenge are allowed.
  • I reserve the right to ban certain challenges if they are widely applicable (could be applied to the majority of all submissions).
  • Thanks to Daniel for the initial idea!

Uncracked Submissions:

<script>site = 'meta.codegolf'; postID = 5686; isAnswer = false; QUESTION_ID = 100357;</script><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)</code></pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

Nathan Merrill

Posted 2016-11-18T19:10:15.417

Reputation: 13 591

Are cops required to provide any information about the nature of the code's expected input? (e.g. a lot of input might be invalid and cause the code to crash) – Gabriel Benamy – 2016-11-18T19:15:27.700

No, the cops only need to provide the code + language. – Nathan Merrill – 2016-11-18T19:16:47.303

2Related meta post – Loovjo – 2016-11-18T19:21:12.420

What are the rules about languages which are newer than the challenge? Are they disallowed due to being newer than this challenge, or newer than the hidden challenge? – None – 2016-11-18T19:24:12.913

Languages newer than the hidden challenge are allowed. – Nathan Merrill – 2016-11-18T19:26:03.903

Any limit as to how many submissions per user, or per user and language? – Luis Mendo – 2016-11-18T19:42:34.053

Is the byte count we report in this challenge the total number of bytes, or based on the scoring of the challenge we're posting for (i.e. if the challenge offered a % count reduction, would we apply that for our answers here?) – Yodle – 2016-11-18T19:46:22.450

1Byte counts are not required. – Nathan Merrill – 2016-11-18T19:47:52.710

nathan may make it so that any challenge which the program provides valid IOs for is an acceptable crack? – tuskiomi – 2016-11-18T20:30:14.743

@tuskiomi if I understand you, any challenge that the program provides valid input/output for is a valid crack. – Nathan Merrill – 2016-11-18T20:32:01.593

Within an hour on which computer? – Mego – 2016-11-18T23:39:55.563

1There are many challenges where solutions will take much longer than an hour to compute for valid inputs. The time limit is not a good idea. – Mego – 2016-11-18T23:51:11.667

Rather than trying to indirectly prevent the impossible hash answers with the time limit, i think you should just directly ban hashing... – FlipTack – 2016-11-18T23:53:37.570

I disagree. There are lots of other ways to get around hashing (unscramble and eval). I prefer the time limit. If the challenge can't be solved in under an hour, then that's an unfortunate side effect – Nathan Merrill – 2016-11-18T23:57:15.427

2@NathanMerrill The current phrasing suggests that if there exists an input that will take an hour to compute the result for, the answer is not valid. This means basically every non-trivial challenge. – a spaghetto – 2016-11-19T00:00:01.387

1Obligatory link to the Things to Avoid post. – Mego – 2016-11-19T00:13:10.723

1I don't understand the urgency to ban cryptographic hashes since they are unlikely to be useful to cops. – feersum – 2016-11-19T04:25:32.350

Counterexample: generate every possible program until you generate one that matches a hash. Run it. – Nathan Merrill – 2016-11-19T04:27:26.923

4@NathanMerrill Not feersum here, but as I've commented on Mego's submission, there's no guarantee you won't hit another hash collision before the intended one. I believe cops should have to be certain that their program is indeed the first one that matches, in which case if the cop can verify it then robbers can too. – Sp3000 – 2016-11-19T04:31:36.347

@NathanMerrill That does NOT work. Collision avoidance of cryptographic hashes is based on probability, not magic. – feersum – 2016-11-19T04:32:50.470

@feersum why not? – Nathan Merrill – 2016-11-19T04:33:41.993

Sp already explained it. – feersum – 2016-11-19T04:35:12.340

1Having said that, other forms of cryptography might be problematic, e.g. semiprime factorisation which is a problem most CnRs have (just a side note). – Sp3000 – 2016-11-19T04:45:51.447

We need a PPCG-introspection tag :-) – Luis Mendo – 2016-11-19T11:22:14.620

I'm a bit unsure about the rules regarding single value outputs... Would a challenge asking for the number of letters in a string be disallowed, since the output is a single number? What about finding the n'th prime? What about challenges asking for true/false? – Stewie Griffin – 2016-11-19T23:48:39.513

The key here is that they allow any numerical output for any input (aka, it doesn't matter what number you print, it's valid) – Nathan Merrill – 2016-11-19T23:51:09.990

That said, it was simply a reiteration of the clearer requirement: The challenge must have restrictions on valid output. I removed it in interest of clarity – Nathan Merrill – 2016-11-19T23:54:14.977

1Total score 348. What was the winning criteria? – Blue – 2016-11-26T18:59:14.113

Answers

11

Pip, 9 bytes (safe, 15 points)

(q`\w+`1)

What it does should be easy to figure out, but the question is why... (TIO)


The challenge was What's the Language? The goal: parse the name of the programming language out of a PPCG answer header. For instance:

Input: <h1>JavaScript, 13 chars / 32 bytes</h1>
Desired Output: JavaScript

I'm not sure whether this falls afoul of "The challenge must have restrictions on valid output," since it's a challenge scored by "percent of tests you get correct," and thus doesn't require the output to be correct for all input. However, I will say that the code above gets about a 60% correct rate, which isn't bad for something so simple.

DLosc

Posted 2016-11-18T19:10:15.417

Reputation: 21 213

seems like it's splitting a string on commas and returning the 2nd string in the resulting split O_O I don't know pip, but that's all I got so far. – Yodle – 2016-11-18T20:47:43.620

2@Yodle splitting it into regex words, not just into commas – Maltysen – 2016-11-18T21:06:06.510

Translated into pyth I believe this is something like ht:w"\w+"1 / @:w"\w+"1 1, which minifies to htcw / htcz if only whitespace matters, but none of those turn up any results. Also this would be able to pull out minutes from HH:mm:ss format, or extract a variable name from a C-style declaration, or numbers after a decimal point. But I can't find questions which ask for any of those things... :/ – Dave – 2016-11-20T23:57:38.047

3

Perl - Cracked by DLosc

Let's give an easy one for the non-esolang people

Run with -nl

say $_ ~~ reverse y-"({[]})"-")}][{("-r;;r-")}][{("-"({[]})"-y esrever ~~ _$ yas

Challenge: Convenient Palindrome Checker

The code crashes after printing the truthiness, but according to this meta post, as long as it produces the correct output before it crashes, and any errors are output to STDERR, it's a valid solution.

Gabriel Benamy

Posted 2016-11-18T19:10:15.417

Reputation: 2 827

5As if Perl is easier to read than an esolang :P – ETHproductions – 2016-11-18T20:33:58.743

1Yeah I don't know any esolangs, but I also don't know Perl :( – Yodle – 2016-11-18T20:35:30.783

Cracked – DLosc – 2016-11-18T21:17:07.640

Dangit, I was going to post that exact thing until the post was deleted earlier (I also couldn't figure out how to get it to run on ideone) – ETHproductions – 2016-11-18T21:55:20.893

For any future entries, I'll submit an ideone link with an explanation of how to run it. – Gabriel Benamy – 2016-11-18T21:59:05.237

3

Perl, 56 bytes, Safe (14 points)

undef$/;print+(<>^<>)=~y/\x81-\xff\x00-\x80/\x01-\xff/dr

The challenge was this one, requiring you to create a diffing algorithm; you need to be able to input two files and output a diff, or input a file and a diff and output the other file. The scoring of that challenge is , making the smallest diff the winner; however, this challenge doesn't require the answer to be competitive, simply compliant with the spec, so I wrote a diffing program in a golfed way instead, which simply uses XOR to combine the inputs (meaning that the same program works for diffing and un-diffing).

The hardest part is reproducing the length of the original files. The input is specified as ASCII, which is a seven-bit character set, thus allowing me to use the eighth bit to track the length of the file. When diffing, we set the high bit of every byte using a y/// instruction (which is slightly more obfuscated than bitwise arithmetic would be). When un-diffing (recognised via noting that the input already has the high bit set), we remove NULs from the output. (I've just realised that this would fail if the input contained NUL bytes; however, the challenge is defined in terms of a test battery, and luckily I don't think there are NUL bytes in the battery. If there are, then this program would be incorrect and would need to be disqualified; a problem with a is that nobody else has enough information to point out easily fixed flaws in your answer!)

user62131

Posted 2016-11-18T19:10:15.417

Reputation:

Safe, methinks. – msh210 – 2016-11-27T20:26:04.610

3

Perl, safe, 18 points

Edit : I modified the end of the code (see the edit history) to handle an edge case (the challenge doesn't say anything about it, and the author did not answer when asked about it, but at least this code handles it). But the algorithm and the logic of the code remain the same.

perl -n0E '/.*/;s/(^0|A)(.{@{+}})?0/A$2A/s||s/0(.{@{+}})?A/A$1A/s?redo:say/A$/+0'

This code isn't obfuscated (just golfed). (This implies that -n0E aren't optional).

I don't realize whether this is hard or not, but I guess I'll be fixed when someone cracks it.


Explanations:

The challenge was Can maze be solved?.

This code will find every reachable cell of the maze (and mark them with a A): if a cell touches a cell marked with a A, the it's reachable and we mark it with a A too; and we do that again (redo). That's done thanks to two regex: s/(^0|A)(.{@{+}})?0/A$2A/s checks if a space is on the right or the bottom of a A, while s/0(.{@{+}})?A/A$1A/s checks if a space is on the left or on top of a A. At the end, if the last cell contains a A it's reachable, otherwise it's not (that's what say/A$/+0 checks; the +0 is here to make sure the result will be 0 or 1 instead of empty string and 1).
Note that /.*/ will match an entire line, thus setting @+ to the index of the end of the first line, which happens to be the size of a line, which allow use to use .{@{+}} to match exactly as many character as there are on a line. (@{+} is equivalent to @+, but only the former can be used in regex)

To run it:

$ perl -n0E '/.*/;s/(^0|A)(.{@{+}})?0/A$2A/s||s/0(.{@{+}})?A/A$1A/s?redo:say 1-/0$/' <<< "0000001
0000010
1111011
0000000"
1

(and if you replace the 1111011 line with 1111111, the it's not solvable anymore, and the output will be 0 instead of 1)

Dada

Posted 2016-11-18T19:10:15.417

Reputation: 8 279

3

Octave, 15 points! SAFE

@(x,y)find((v=((z=cumsum(x.^2))(y:end)-[0,z(1:end-y)]))==max(v),1)-1

Try it online here.


Explanation:

The code takes an input string x containing ones and zeros, 10010110110101 and an integer y.

To find the moving average of a sequence in MATLAB/Octave you can do:

z = cumsum(x);
movmean = z(y:end) - [0 z(1:end-y)];

Since we're only interested in the location of the maximum, not the actual values, we don't need to care about converting the string to numbers. (x.^2) squares all the ASCII-values 48,49 for 0,1. This is necessary since Octave can't use cumsum directly on characters. cumsum(+x) would be two bytes shorter but would reveal that x is a string.

This is actually quite well golfed (except for the .^2 instead of +). Of course, convolution would be simpler.

Stewie Griffin

Posted 2016-11-18T19:10:15.417

Reputation: 43 471

3

Hexagony, 548 bytes, Cracked

69;{108;\_1$;;;/0;108\56;19|1^\6/15\;72_$23371<};;!;6;33|;;015><;;7;@3?;43+1586;2_3219><11;;'_8;;;2_|3;81|2<|8517;327}1_23;1;4$%;_4{5.1;1332_3;029&;'_};;1..527;2'..35;5212_>97;$;2/0;-;3_2;/233;08.._\901;0/13'}92...>/>/57\53;633;4'22;/|~>;441;45;;$161;371;3/;3.7026;`208;1<}>27;140;217;11.0;/2;692;<01/2;301;18;31/;10;/3;44<1914/111;{98;38;;;13/4;<;3;1;;/;112;<.$13032;..27;1;222/1;0<6..1;0;'..933721389/9<6;.;3;37..;;875;*;;0[1;287]59..902;;2;12;1;59;;3#..4;;1=249$345249;...;012}021#>/;44>114/4201;;;3>0;>;24;3/;;116._4>337;237/$5_>1{32;102;255;'_

Try it online!

Martin Ender

Posted 2016-11-18T19:10:15.417

Reputation: 184 808

This challenge is probably not the one you intended, because the output here changes depending on an input number. But without input it prints the string in that challenge, and "robbers need to find any challenge that the submission is a valid submission for". So, cracked? – Luis Mendo – 2016-11-20T04:39:49.050

@LuisMendo it doesn't quite print that string. – Martin Ender – 2016-11-20T08:15:59.830

(Just to be clear, my answer doesn't print the trailing . required by that challenge.) – Martin Ender – 2016-11-21T10:52:22.310

Yes, I saw :-) My knowledge of Hexagony didn't allow me to progress much... – Luis Mendo – 2016-11-21T10:59:16.460

Cracked. – Stewie Griffin – 2016-11-21T15:47:14.457

@StewieGriffin Nice job. :) – Martin Ender – 2016-11-21T15:48:17.483

2

05AB1E, 27 bytes, cracked!

For this submission, input is also required for it to work. Shouldn't be too hard to crack.

ávyl•B;£¡´•54B•2ît•‡y.li(}O

Explanation (for the challenge):

á                             # Keep all the letters of the input string
 vy                           # For each letter...
   l                          #   Convert to lowercase
    •B;£¡´•54B                #   String that turns into 'pnbrqk'
              •2ît•           #   Compressed int: 133591
                   ‡          #   Transliterates the following:
                                    p -> 1
                                    n -> 3
                                    b -> 3
                                    r -> 5
                                    q -> 9
                                    k -> 1
                    y.li }    #   If the current letter is lowercase...
                        (     #     Negate that number
                          O   # Sum up the result

Uses the CP-1252 encoding. Try it online!

Adnan

Posted 2016-11-18T19:10:15.417

Reputation: 41 965

you post to pastebin?: http://pastebin.com/QyvpUb9b

– tuskiomi – 2016-11-18T19:54:59.093

@tuskiomi Hmm, nope that wasn't me. – Adnan – 2016-11-18T20:07:14.603

that's strange. I googled your result (you gotta make sure) and that was 1 of 3 results. I wonder there is a bot that's pulling answers?? hmm.. – tuskiomi – 2016-11-18T20:09:56.120

Prints the second input – Oliver Ni – 2016-11-18T20:25:16.783

@Oliver not exactly, zyxwvut tuvwxyz doesn't produce an output... – tuskiomi – 2016-11-18T20:32:46.630

1cracked? – Maltysen – 2016-11-18T20:50:03.037

@Maltysen Yep, that was the one! Nice :). – Adnan – 2016-11-18T20:54:24.390

2

MATL. Cracked

&:"@FYAYm7>vs

Try it online!

I indicated input and output even if it's not necessary. Since it's in the edit history anyway: the program inputs two numbers and outputs one number.

Luis Mendo

Posted 2016-11-18T19:10:15.417

Reputation: 87 464

Cracked :-) – ETHproductions – 2016-11-18T20:31:19.420

@ETHproductions Oh, how did you find that challenge? I picked it literally randomly .-) – Luis Mendo – 2016-11-18T20:34:38.980

2

C#, 590 bytes, Cracked

(I,N)=>{string R="",p="`1234567890-=",P="~!@#$%^&*()_+",q="qwertyuiop[]\\",Q="QWERTYUIOP{}|",a="asdfghjkl;\'",A="ASDFGHJKL:\"",z="zxcvbnm,./",Z="ZXCVBNM<>?";foreach(var c in I){var f=c+"";if(p.Contains(f))R+=p[(p.IndexOf(c)+N)%13];else if(P.Contains(f))R+=P[(P.IndexOf(c)+N)%13];else if(q.Contains(f))R+=q[(q.IndexOf(c)+N)%13];else if(Q.Contains(f))R+=Q[(Q.IndexOf(c)+N)%13];else if(a.Contains(f))R+=a[(a.IndexOf(c)+N)%11];else if(A.Contains(f))R+=A[(A.IndexOf(c)+N)%11];else if(z.Contains(f))R+=z[(z.IndexOf(c)+N)%10];else if(Z.Contains(f))R+=Z[(Z.IndexOf(c)+N)%10];else R+=c;}return R;};

Probably pretty easy, also a fairly long program ,_,

Yodle

Posted 2016-11-18T19:10:15.417

Reputation: 2 378

Lambda is Func<string, int, string>. Looks like it's some keyboard cipher. The number param is how many chars to shift right on the keyboard (ie- ("t",1) = y). – milk – 2016-11-18T20:40:12.450

Cracked – milk – 2016-11-18T20:48:49.820

Nice, wasn't expecting that to last too long :P – Yodle – 2016-11-18T20:52:13.950

2

MATL. Safe, 93 points

dP7EGn:q^1J2/h)ts_hX=Gs[BE]Wd=~>~GBz*

Try it online!


Explanation

The challenge was Source code ecological footprint.

The code computes the Hamming weight (number of ones) in the binary representation of the ASCII codes of the input string; except that the string test outputs 0 (instead of its Hamming weight, which is 17).

The special-casing of that string is a little obfuscated. The program first computes the array of consecutive differences of the ASCII codes of the input and reverses it. For test this gives [1 14 -15].

Then, the array formed by the first n powers of 14 is computed ([1 14 196 ...]), where n is input length; and the first floor(n/2) values are kept. So for input test this gives [1 14]. The negated sum is appended to this array, which gives [1 14 -15] for input test. This is tested for equality with the reversed array of consecutive differences which was previously obtained.

On the other hand, the sum of the ASCII codes of input chars is computed and compared with 448, generated as the (consecutive) difference of the elements in the array [2^6 2^9] (where ^ denotes power).

The input test is the only string with reversed consecutive differences of the form [1 14 -15] and sum 448. Differences [] or [1] (for shorter inoyt strings) are not compatible with a total sum of 448. Differences [1 14 196] or larger cannot be achieved with ASCII characters.

The code checks if the result of the test for the first condition (consecutive differences) is not smaller than the negated result of the second condition (total sum). This gives 0 if and only if both conditions were satisfied. Finally, this is multiplied by the number of ones in the binary representation of the ASCII codes of the input.

Luis Mendo

Posted 2016-11-18T19:10:15.417

Reputation: 87 464

Try it Online please. – tuskiomi – 2016-11-18T20:46:23.907

@tuskiomi Done. But since you have to guess the input format, it's not much use... – Luis Mendo – 2016-11-18T20:47:27.503

Numbers seem to work well. – tuskiomi – 2016-11-18T20:50:18.007

Cracked! – boboquack – 2016-11-19T05:11:56.047

@boboquack Not quite :-) My code's output is not the Hamming distance of an input (although that may be the case for the inputs you have tried) – Luis Mendo – 2016-11-19T11:18:30.547

In my answer, it had the Hamming weight of the input, not the distance. If your answer doesn't calculate that, or doesn't calculate the number of set bits (the same thing), could you please give me a counterexample so that I can continue trying to crack it? – boboquack – 2016-11-19T20:54:56.837

@boboquack I'm not sure what I could say without giving too much of a hint... – Luis Mendo – 2016-11-20T03:23:13.270

2This might be a winner... :) – Stewie Griffin – 2016-11-26T13:24:26.210

2

JungHwan Min

Posted 2016-11-18T19:10:15.417

Reputation: 13 290

1Cracked – milk – 2016-11-19T00:47:26.543

@milk Wow! That was quick! – JungHwan Min – 2016-11-19T00:48:27.717

2

CJam (safe, 21 points)

{W+W%~1{1$)}{)a1${\(+W%{1$1$-2=>}{+}w}{\;}?)_@*\+~}w+}

This is an anonymous block (function).

Peter Taylor

Posted 2016-11-18T19:10:15.417

Reputation: 41 901

2

Python, 935 Bytes

def oo000 ( num ) :
 return - ~ num
def ii ( num ) :
 return - ( oo000 ( oo000 ( ~ num ) ) )
def oOOo ( num1 , num2 ) :
 while num2 > 0 :
  num1 = oo000 ( num1 )
  num2 = ii ( num2 )
 return num1
 if 59 - 59: Oo0Ooo . OO0OO0O0O0 * iiiIIii1IIi . iII111iiiii11 % I1IiiI
def IIi1IiiiI1Ii ( num1 , num2 ) :
 I11i11Ii = num2
 oO00oOo = 0
 while I11i11Ii > 0 :
  oO00oOo = oOOo ( oO00oOo , num1 )
  I11i11Ii = ii ( I11i11Ii )
  if 92 - 92: O0O / oo000i1iIi11iIIi1 % Iii1IIIiiI + iI - Oo / o0O
 return oO00oOo
def hgj ( num1 , num2 ) :
 I11i11Ii = num2
 oO00oOo = 1
 while I11i11Ii > 0 :
  oO00oOo = IIi1IiiiI1Ii ( oO00oOo , num1 )
  I11i11Ii = ii ( I11i11Ii )
  if 48 - 48: iII111i % IiII + I1Ii111 / ooOoO0o * o00O0oo
 return oO00oOo
def O0oOO0o0 ( num1 , num2 ) :
 return oOOo ( num1 , - num2 )
 if 9 - 9: o0o - OOO0o0o
 if 40 - 40: II / oo00 * Iii1IIIiiI * o0o . ooOoO0o
print(hgj ( 9 , 9999 ))
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3

Sorry I used a obfuscator, but it isn't forbidden and way easier. (And I didn't have all that time to do it myself...)

Mega Man

Posted 2016-11-18T19:10:15.417

Reputation: 1 379

Now, I don't even understand that code for myself... – Mega Man – 2016-11-19T12:02:09.400

1It's easy to deobfuscate, but the questions which it might fit all seem to be tagged [tag:busy-beaver]... – Peter Taylor – 2016-11-19T14:00:34.443

Nice obfuscation! – OldBunny2800 – 2016-11-19T14:05:34.313

This computes 9**99 without printing anything (Also taking a long time to do it) – Blue – 2016-11-19T14:17:44.653

@PeterTaylor It isn't a busy-beaver question, I just took a strange way to solve the question. – Mega Man – 2016-11-20T09:00:53.510

@OldBunny2800 If you want to try it out yourself, it's called pyobfuscate. Here's the github repo: https://github.com/astrand/pyobfuscate

– Mega Man – 2016-11-20T09:03:51.803

You can put us out of our misery now... – Peter Taylor – 2016-12-02T08:24:06.807

Cracked. – jimmy23013 – 2016-12-02T09:34:00.780

2

Ruby (cracked by DLosc)

p n = gets.to_i
p n = n*(3*n-1)/2 until n % 7 == 0

histocrat

Posted 2016-11-18T19:10:15.417

Reputation: 20 600

Whoops, I missed the first p when I copied the code over. Cracked, then.

– DLosc – 2016-11-21T02:03:21.280

2

Python 3, ~2000 bytes, (safe: 23 points)


Original Program

exec("\n))o0000o000o<)]))]00000o000o[0o0o0o0o0o0o0o0o0o(00000000000000o0o(000000000000000o0o ni oooo0oooo rof)))0o0o0o0o0o0o0o0o0o(00000000000000o0o(000000000000000o0o ni 00oo00oo00oo00oo00oo rof]oooo0oooo[]00oo00oo00oo00oo00oo[0o0o0o0o0o0o0o0o0o(000ooo000ooo000o[ +]0o0o0o0o0o0o0o0o0o ni 00oo00oo00oo00oo00oo rof)00oo00oo00oo00oo00oo(000ooo000ooo000o[ni ooo000ooo000o rof)ooo000ooo000o(o0o0o0o0o-o0000o000o(000ooo000ooo000o(00o00o00o(tnirp\n)00000o000o,00000o000o(tresni.o0o0o0o0o0o0o0o0o0o:))00000000000000o0o=yek,0o0o0o0o0o0o0o0o0o(xam(00000000000000o0o<)o0o0o0o0o0o0o0o0o0o(00000000000000o0o elihw \n:)]00000o000o[]o0oooo,0o0o0o0o0o0o0o0o0o[( ni o0o0o0o0o0o0o0o0o0o rof\n;'=01NgwiNgwSNbBibpBybw8GMwAzbw8GM'b,]0o0o0o0o00oo ni ooooo0o00oo rof]]::0oooooo0oooo[))ooooo0o00oo(0oooooo(o0oooo ni ooo000ooo000o rof)ooo000ooo000o(00o00o00o[[=ooooo00oo,0o0o0o0o0o0o0o0o0o\n)'=kSZsBXd0BCLn5WayR3cgwCdulGK'b(0o0o.)(0o0ooo0o00ooo.o000oo esle o0000o000o fi o0000o000o+o0000o000o=0oooooo0oooo;)000000000000000o0o(o00oo00o=000000000000000o0o;)))(edoced.)o0o(0oo000o(000000o(o000oo,))(]o0000o000o[]edoced.)'==QbhRHa'b(0oo000o,'oo0o0o00o'[(oo0o0oo=o0o0o0o0o,oo0o0o0oo\n;)00000000000000o0o(o00oo00o,))(edoced.)'vJHZ'b(0oo000o(o00oo00o,)'bin'(o00oo00o=00000000000000o0o,0oooooo,o0oooo;))0000o0o0o(000000o(o000oo:0000o0o0o adbmal = o00oo00o ;)))(0o0oo00o(0oooooo(0o0oo0oo=0o0o0o0o00oo\n00000000000001**o0000o000o=o0000o000o;))(edoced.)'=cSbhRHanwCd1BnbpxyXfRncvBXbp91Xs4WavpmLnAyJ'b(0oo000o(o000oo=o0oo0oo00o,0o0oo00o,o0oo0oo,0o0oo0oo;edoced46b.)000oo0o(oo0o0oo=0oo000o\n;'==QYsxGKb92bwADMvVCN8EDIm9mcg8GMvBSauBybw82bwADMvBzbdliKq4SN'b ,))0o0oo00oo(000000o(__tropmi__ :0o0oo00oo adbmal,'base64',]0o0oo00oo[:0o0oo00oo adbmal = oo00oo00oo00oo00oo00oo,oo0o0oo,000oo0o,0oooooo\n;tni,'range','len','==Abh1mYkFGIv9GMwAzb682bwADMvBSYuRGIv9GMvBzbw82buYWYjR3bylWYshybvBDMw8WLxkiKqITJv9GMwAzb'b,lave,0**0000000000000009,0 ,]1-::[0o0ooo0o00o0oo:0o0ooo0o00o0oo adbmal,mus = 00o00o00o,000000000000000o0o,00000000000000o0o,o0o,o000oo,o0000o000o,00000o000o,000000o,000ooo000ooo000o\n"[::-1])

Challenge

This is in fact an answer for my own challenge, Primenary Strings. I chose this as almost everything will output 0, apart from a few inputs that a robber would be unlikely to enter. The code is a simple algorithm, but heavily obfuscated (by hand).

FlipTack

Posted 2016-11-18T19:10:15.417

Reputation: 13 242

1

Pyke, 3458 bytes, SAFE, score 99

wB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddnwB"["R";7m"ddddddddddddddddddddddddddwE"["R";7m"ddddddddddddddddddddddddddw?"["R";7m"ddddddddddddddddddddddddddsQI30>Q%)

Try it here!

There are a few (30) 0x1b bytes that seem to have been eaten by SE.

Blue

Posted 2016-11-18T19:10:15.417

Reputation: 26 661

you can mark this as safe now – FlipTack – 2016-11-26T15:28:01.433

1

Haskell, SAFE

m f=map(f<$>)
g=reverse.("":)
f s|(f:c:s)<-m fromEnum.g.words$s,
    (f:c:s)<-init.unwords.g.m(\s->toEnum$if c!!0==s||s==sum(-32:c)then(last$f)else s)$s=init$s

Try it on Ideone. "Usage":

Prelude> f "Programming Puzzles & Code Golf"
"rogramming Puzzles "

In the String Shenanigans challenge one is given a string and two chars and should then replace every occurrence of the first char with the second. However, the input is one string only containing the actual string in quotation marks and the two characters whitespace separated:

Prelude> f "\"Hello, World!\" l r"
"Herro, Worrd!"

Laikoni

Posted 2016-11-18T19:10:15.417

Reputation: 23 676

1

Octave, 40 points. SAFE

Slightly obfuscated answer to a fairly popular challenge.

y=find((x=mod(input('')*2,32))>12);sign(sum(x.*[1-y:nnz(x+8)-y]))

I recommend testing this on octave-online. Ideone is not that good when it comes to STDIN.


This was the lever simulator 2015 challenge. Input on the form '123^32. Output will be -1 0 1 for Left-heavy, Balanced and Right-heavy in that order.

It looks like this when it's fully golfed:

s=mod(input(''),16);i=find(s>9);s*[1-i:numel(s)-i]'*inf

This outputs -Inf, NaN, Inf for L,B,R respectively.

Stewie Griffin

Posted 2016-11-18T19:10:15.417

Reputation: 43 471

1why did Oliver edit in the byte count? this isn't codegolf, and the answer doesn't have to be competitive to the challenge, just valid – FlipTack – 2016-11-21T18:10:39.527

1

JavaScript, 533 bytes, Cracked! by Dave

_=this;[490837,358155,390922].map(y=function(M,i){return _[[
U=[y+[]][+[]]][+[]][i]]=_[M.toString(2<<2<<2)]});function g(
s){return Function("a","b","c","return "+s)};e=g(u(["","GQ9\
ZygiYTwyPzE6YSpk","C0tYSki","SkoYSkvZChhLWIpL2QoYikg"].join(
"K")));h=g("A=a,B=b,g('A(a,B(a))')");j=g("a/b");L=g("Z=a,Y=\
b,g('Z(a,Y)')");k=L(j,T=2);F=g(u("KScpKWIsYShFLCliLGEoQyhEJ\
yhnLGM9RSxiPUQsYT1D").split("").reverse().join(""));RESULT=F
(h(e,k),j,g("_[U[10]+[![]+[]][+[]][++[+[]][+[]]]+[!+[]+[]][\
+[]][+[]]+17..toString(2<<2<<2)].pow(T,a)"));

Not my favorite obfuscation of mine, but it's kinda neat. Call as RESULT(inputs).

I might award a +50 point bounty if you explain in detail what my code is doing along with your crack. (They do not have to be together, so feel free to FGITW if that suits your whims.)

Conor O'Brien

Posted 2016-11-18T19:10:15.417

Reputation: 36 228

Cracked! http://codegolf.stackexchange.com/a/100591/8927

– Dave – 2016-11-21T01:02:06.223

1

Pip, 13 bytes

V$.C(A*a-A9)a

Try it online (give input as Arguments, not Input).

DLosc

Posted 2016-11-18T19:10:15.417

Reputation: 21 213

1

TeX, 240 bytes, SAFE, score 129

\let\N\newcount\let\I\ifnum\let\A\advance\let\E\else\N\a\N\b\N\c\def\D#1:#2:#3:{\I#1>#2\A#1by-#2\D#1:#2:#3:\E\I#1=#2 #3=1\E#3=0\fi\fi}\def\P#1:#2:{\I#1>#2\a=#1\D\a:#2:\c:\I\c=0\b=#2\A\b by1\P#1:\the\b:\E N\fi\E\I#1=1 N\E Y\fi\fi}\P1:2:\end

Save as jeopardy.tex, then run pdftex jeopardy.tex and open jeopardy.pdf.

Outcome: a PDF with the text N (and the page number 1).

user42682

Posted 2016-11-18T19:10:15.417

Reputation:

0

Python 3, Cracked!

Writing this was hilarious, even though it was easily crackable in the end :)

Z,O=__import__('time').strftime,401*5;from base64 import*;Q,I=(Z('%Y')),(O/401)*2;_=int(Q);D,P=(O,-~_),int(Q[~1:]);Q,I=(6+(P-eval(b64decode(b'KHN1bShbeCU0PDEgZm9yIHggaW4gcmFuZ2UobWluKEQpLG1heChEKSldKSk=').decode()+'*-1'*(O>_)))/10,'3'+repr(((P-10)*3)+10));print(Q,I)

FlipTack

Posted 2016-11-18T19:10:15.417

Reputation: 13 242

base64 encoded message: (sum([x%4<1 for x in range(min(D),max(D))])) – Blue – 2016-11-18T20:59:25.677

yep, just threw that in for fun @BlueEyedBeast – FlipTack – 2016-11-18T21:00:17.270

For some reason. substituting that decoded string in gives me a TypeError >.> – Yodle – 2016-11-18T21:27:56.930

@Yodle Does the original code work? If so, just make sure you substitute the decoded string in properly – FlipTack – 2016-11-18T21:36:48.663

Yeah it does, which is why I am very confused haha. I'm pretty sure I'm doing it right, just removing base64decode(...).decode() with the string right? – Yodle – 2016-11-18T21:38:35.430

cracked. – Maltysen – 2016-11-18T21:39:38.893

@Yodle now that it's cracked, I'll tell you why you probably have an error: You need to put quotation marks around the subsituted code. – FlipTack – 2016-11-18T21:42:25.567

@Maltysen good job! – FlipTack – 2016-11-18T21:42:47.893

@Flp.Tkc Aha, I tried doing str() around it but I might've done that wrong. I was on the right track though :P – Yodle – 2016-11-18T21:43:20.070

0

Pyke, 42 characters, SAFE, score 85

This was probably unfair as the code stopped working in the try-it link 3 days after this answer was posted. I am happy for this answer to be non-competing

cFDhkR.dۢ㒶οd-~o@l3{IoKRKn)R+(Jt~o16q*Q|

Try it here!

Subliminal message intended towards cracker.

Blue

Posted 2016-11-18T19:10:15.417

Reputation: 26 661

really belongs there? – Erik the Outgolfer – 2016-11-18T22:07:32.087

yep and so do the other 3 unprintables – Blue – 2016-11-18T22:09:58.837

You mean 4 unprintables, right? – Erik the Outgolfer – 2016-11-18T22:11:21.287

yes I do - (one of them is invisible in my browser/blends in) – Blue – 2016-11-18T22:12:01.063

This doesn't seem to be a good answer to the original challenge. You're simply splitting the text into new words on each line, regardless of where the capital letters are. – Stewie Griffin – 2016-11-26T19:45:06.343

@StewieGriffin The try-it-here link worked for at least 3 days before I made a breaking change. I agree that was pretty unfair. Last working commit: https://github.com/muddyfish/PYKE/commit/5c2cd9a243f79d449ae847885608d38bc264d26c. Or this new link that works on the new version (an extra d character is required as I changed the default for Join to a newline rather than a space) http://pyke.catbus.co.uk/?code=cFDhkR.d%05%DB%A2%05%04%E3%92%B6%CE%BFd-~o%40l3%7BIoKRKn%29R%2B%28dJt~o16q%2aQ%7C

– Blue – 2016-11-26T20:17:39.593

0

Pyke, 20 bytes, SAFE, score 59

uÄCMX67+*]mA""R`.:

Try it here!

Blue

Posted 2016-11-18T19:10:15.417

Reputation: 26 661

0

Pyth - Cracked by Maltysen

If it helps, Pyth was not any of the answers to the hidden challenge.

u=.+G.*A

Try it out!

Steven H.

Posted 2016-11-18T19:10:15.417

Reputation: 2 841

cracked? – Maltysen – 2016-11-18T21:57:26.280

Cracked! That was fast. – Steven H. – 2016-11-18T21:59:19.247

0

C#, 91 bytes

_=>{int b=0,w=0;for(;1>w||0<*(_-1);b+=++w**_++<<(9*w));return b%(3<w?903302656:41458688);};

milk

Posted 2016-11-18T19:10:15.417

Reputation: 3 043

0

Mathematica, 34 bytes, Cracked

±1={±0={}};±n_:=Array[±#&,n,0]

Named function (±).

JungHwan Min

Posted 2016-11-18T19:10:15.417

Reputation: 13 290

I can't tell whether it's this and you overlooked the "No digits 0 to 9 to appear in the code" rule, or whether it's this and you decided to take unary input for obfuscation.

– Martin Ender – 2016-11-19T10:16:27.053

Whoops, it's the first one, but I totally missed that rule... I'll change the code to fit the other one :) – JungHwan Min – 2016-11-19T16:01:20.237

Cracked then. ;) – Martin Ender – 2016-11-19T19:54:50.010

0

Pyke, 18 bytes, SAFE, score 54

2fm}s"ab"NQlZh.&|!

Try it here!

Blue

Posted 2016-11-18T19:10:15.417

Reputation: 26 661

0

Pyke, 19 bytes, SAFE, score 51

4\Y:\m+Ay""%b%y"cl2

Try it here!

Blue

Posted 2016-11-18T19:10:15.417

Reputation: 26 661

0

C++14, Cracked

#include<vector>

auto h(auto i){return 0;}
auto h(auto i, auto x, auto...p){
 return x+(i-1?h(i-1,p...):0);
}

auto g(auto v){return v;}
auto g(auto v,auto x, auto...p){
 v.push_back(h(x,x,p...));
 return g(v,p...);
}

auto f(auto...p){
 return g(std::vector<int>{},p...);
}

Takes a variadic number of parameters and returns a vector<int>.

Usage:

int main() {
 auto v = f(4,7,3,4,5);
 for (auto i:v) std::cout << i << ", ";
 std::cout << std::endl;
}

Karl Napf

Posted 2016-11-18T19:10:15.417

Reputation: 4 131

The title says C++14, so you need at least g++ and if your version is not at least 6.2 or something you need -std=c++14 – Karl Napf – 2016-11-19T13:45:24.740

1Cracked – Peter Taylor – 2016-11-19T14:11:50.953

0

BrainFuck - 140 Bytes, Cracked by daHugLenny

,>,>,>-[>+<-----]>---[<+>-]<[<<<->>>->+<]>[<<<->>>->+<]>[<<<->>>-]<<<[>+<-]<[>>++++++++++<<-]<[>>>>++++++++++[<++++++++++>-]<<<<-]>>>[>.+<-]

Try It Here!

FinW

Posted 2016-11-18T19:10:15.417

Reputation: 477

1Cracked – acrolith – 2016-11-19T16:03:07.780

0

Mathematica, 161 bytes

Which[LetterQ@#,If[UpperCaseQ@#,ToUpperCase,#&][FromLetterNumber~Array~LetterNumber@#],DigitQ@#,Array[IntegerString,FromDigits@#+1,0],True,#]&/@Characters@#<>""&

JungHwan Min

Posted 2016-11-18T19:10:15.417

Reputation: 13 290

0

Ruby, 50 bytes

count = 0; 400.times do count +=1; end; puts count

output: 400

dkudriavtsev

Posted 2016-11-18T19:10:15.417

Reputation: 5 781

Cracked. – Martin Ender – 2016-11-21T10:57:09.620

0

Python 2.7, 45 bytes

import numpy;lambda a,n,t:numpy.arange(a,t,n)

Hint (or maybe not): "the fish is in using numpy."

2016.11.23 - second hint: "Don't leave anything floating around!"

agtoever

Posted 2016-11-18T19:10:15.417

Reputation: 2 661

Are all three inputs strictly necessary? Could this still work if you hard code one (or more) of the inputs? – Stewie Griffin – 2016-11-21T13:21:34.747

@StewieGriffin Yes. The questions explicitly requires three inputs; as well in the text as well as in the test cases. – agtoever – 2016-11-21T13:50:29.087

-2

Jelly, 1 byte, cracked

Body must be at least 30 characters; you entered 15.

Oliver Ni

Posted 2016-11-18T19:10:15.417

Reputation: 9 650

Ṛ Reverse array Does not vectorize. from:https://github.com/DennisMitchell/jelly/wiki/Atoms

– tuskiomi – 2016-11-18T20:26:37.047

4http://codegolf.stackexchange.com/a/100370/31343 cracked? – Maltysen – 2016-11-18T20:27:25.523

If this wasn't cracked, you would have gained -22 points :p – Adnan – 2016-11-18T20:28:49.917

It's golf so -22 points is good, right? – milk – 2016-11-18T20:29:48.960

Now it's -23 points, to be exact. That one is a remnant of my immaturity stage. – Erik the Outgolfer – 2016-11-18T22:05:35.433