45
\$\begingroup\$

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>

\$\endgroup\$
  • 2
    \$\begingroup\$ Related meta post \$\endgroup\$ – Loovjo Nov 18 '16 at 19:21
  • 1
    \$\begingroup\$ Byte counts are not required. \$\endgroup\$ – Nathan Merrill Nov 18 '16 at 19:47
  • 1
    \$\begingroup\$ There 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. \$\endgroup\$ – Mego Nov 18 '16 at 23:51
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ – a spaghetto Nov 19 '16 at 0:00
  • 4
    \$\begingroup\$ @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. \$\endgroup\$ – Sp3000 Nov 19 '16 at 4:31

35 Answers 35

11
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Yodle Nov 18 '16 at 20:47
  • 2
    \$\begingroup\$ @Yodle splitting it into regex words, not just into commas \$\endgroup\$ – Maltysen Nov 18 '16 at 21:06
  • \$\begingroup\$ 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... :/ \$\endgroup\$ – Dave Nov 20 '16 at 23:57
3
\$\begingroup\$

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.

\$\endgroup\$
  • 5
    \$\begingroup\$ As if Perl is easier to read than an esolang :P \$\endgroup\$ – ETHproductions Nov 18 '16 at 20:33
  • 1
    \$\begingroup\$ Yeah I don't know any esolangs, but I also don't know Perl :( \$\endgroup\$ – Yodle Nov 18 '16 at 20:35
  • \$\begingroup\$ Cracked \$\endgroup\$ – DLosc Nov 18 '16 at 21:17
  • \$\begingroup\$ 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) \$\endgroup\$ – ETHproductions Nov 18 '16 at 21:55
  • \$\begingroup\$ For any future entries, I'll submit an ideone link with an explanation of how to run it. \$\endgroup\$ – Gabriel Benamy Nov 18 '16 at 21:59
3
\$\begingroup\$

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!

\$\endgroup\$
  • \$\begingroup\$ 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? \$\endgroup\$ – Luis Mendo Nov 20 '16 at 4:39
  • \$\begingroup\$ @LuisMendo it doesn't quite print that string. \$\endgroup\$ – Martin Ender Nov 20 '16 at 8:15
  • \$\begingroup\$ (Just to be clear, my answer doesn't print the trailing . required by that challenge.) \$\endgroup\$ – Martin Ender Nov 21 '16 at 10:52
  • \$\begingroup\$ Yes, I saw :-) My knowledge of Hexagony didn't allow me to progress much... \$\endgroup\$ – Luis Mendo Nov 21 '16 at 10:59
  • \$\begingroup\$ Cracked. \$\endgroup\$ – Stewie Griffin Nov 21 '16 at 15:47
3
\$\begingroup\$

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)

\$\endgroup\$
3
\$\begingroup\$

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!)

\$\endgroup\$
  • \$\begingroup\$ Safe, methinks. \$\endgroup\$ – msh210 Nov 27 '16 at 20:26
3
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Cracked :-) \$\endgroup\$ – ETHproductions Nov 18 '16 at 20:31
  • \$\begingroup\$ @ETHproductions Oh, how did you find that challenge? I picked it literally randomly .-) \$\endgroup\$ – Luis Mendo Nov 18 '16 at 20:34
2
\$\begingroup\$

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 ,_,

\$\endgroup\$
  • \$\begingroup\$ 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). \$\endgroup\$ – milk Nov 18 '16 at 20:40
  • \$\begingroup\$ Cracked \$\endgroup\$ – milk Nov 18 '16 at 20:48
  • \$\begingroup\$ Nice, wasn't expecting that to last too long :P \$\endgroup\$ – Yodle Nov 18 '16 at 20:52
2
\$\begingroup\$

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!

\$\endgroup\$
  • \$\begingroup\$ you post to pastebin?: pastebin.com/QyvpUb9b \$\endgroup\$ – tuskiomi Nov 18 '16 at 19:54
  • \$\begingroup\$ @tuskiomi Hmm, nope that wasn't me. \$\endgroup\$ – Adnan Nov 18 '16 at 20:07
  • \$\begingroup\$ 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.. \$\endgroup\$ – tuskiomi Nov 18 '16 at 20:09
  • \$\begingroup\$ Prints the second input \$\endgroup\$ – Oliver Ni Nov 18 '16 at 20:25
  • 1
    \$\begingroup\$ cracked? \$\endgroup\$ – Maltysen Nov 18 '16 at 20:50
2
\$\begingroup\$

아희(Aheui), 0 bytes, Cracked



Try it here! (The program is already typed in for you :p )

\$\endgroup\$
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – milk Nov 19 '16 at 0:47
  • \$\begingroup\$ @milk Wow! That was quick! \$\endgroup\$ – JungHwan Min Nov 19 '16 at 0:48
2
\$\begingroup\$

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...)

\$\endgroup\$
  • \$\begingroup\$ Now, I don't even understand that code for myself... \$\endgroup\$ – Mega Man Nov 19 '16 at 12:02
  • 1
    \$\begingroup\$ It's easy to deobfuscate, but the questions which it might fit all seem to be tagged busy-beaver... \$\endgroup\$ – Peter Taylor Nov 19 '16 at 14:00
  • \$\begingroup\$ Nice obfuscation! \$\endgroup\$ – OldBunny2800 Nov 19 '16 at 14:05
  • \$\begingroup\$ This computes 9**99 without printing anything (Also taking a long time to do it) \$\endgroup\$ – Blue Nov 19 '16 at 14:17
  • \$\begingroup\$ @PeterTaylor It isn't a busy-beaver question, I just took a strange way to solve the question. \$\endgroup\$ – Mega Man Nov 20 '16 at 9:00
2
\$\begingroup\$

Ruby (cracked by DLosc)

p n = gets.to_i
p n = n*(3*n-1)/2 until n % 7 == 0
\$\endgroup\$
  • \$\begingroup\$ Whoops, I missed the first p when I copied the code over. Cracked, then. \$\endgroup\$ – DLosc Nov 21 '16 at 2:03
2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Try it Online please. \$\endgroup\$ – tuskiomi Nov 18 '16 at 20:46
  • \$\begingroup\$ @tuskiomi Done. But since you have to guess the input format, it's not much use... \$\endgroup\$ – Luis Mendo Nov 18 '16 at 20:47
  • \$\begingroup\$ Numbers seem to work well. \$\endgroup\$ – tuskiomi Nov 18 '16 at 20:50
  • \$\begingroup\$ Cracked! \$\endgroup\$ – boboquack Nov 19 '16 at 5:11
  • 2
    \$\begingroup\$ This might be a winner... :) \$\endgroup\$ – Stewie Griffin Nov 26 '16 at 13:24
2
\$\begingroup\$

CJam (safe, 21 points)

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

This is an anonymous block (function).

\$\endgroup\$
2
\$\begingroup\$

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).

\$\endgroup\$
1
\$\begingroup\$

Pip, 13 bytes

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

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

\$\endgroup\$
1
\$\begingroup\$

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.)

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ you can mark this as safe now \$\endgroup\$ – FlipTack Nov 26 '16 at 15:28
1
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ why 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 \$\endgroup\$ – FlipTack Nov 21 '16 at 18:10
1
\$\begingroup\$

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!"
\$\endgroup\$
1
\$\begingroup\$

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).

\$\endgroup\$
0
\$\begingroup\$

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)
\$\endgroup\$
  • \$\begingroup\$ base64 encoded message: (sum([x%4<1 for x in range(min(D),max(D))])) \$\endgroup\$ – Blue Nov 18 '16 at 20:59
  • \$\begingroup\$ yep, just threw that in for fun @BlueEyedBeast \$\endgroup\$ – FlipTack Nov 18 '16 at 21:00
  • \$\begingroup\$ For some reason. substituting that decoded string in gives me a TypeError >.> \$\endgroup\$ – Yodle Nov 18 '16 at 21:27
  • \$\begingroup\$ @Yodle Does the original code work? If so, just make sure you substitute the decoded string in properly \$\endgroup\$ – FlipTack Nov 18 '16 at 21:36
  • \$\begingroup\$ 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? \$\endgroup\$ – Yodle Nov 18 '16 at 21:38
0
\$\begingroup\$

Pyth - Cracked by Maltysen

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

u=.+G.*A

Try it out!

\$\endgroup\$
  • \$\begingroup\$ cracked? \$\endgroup\$ – Maltysen Nov 18 '16 at 21:57
  • \$\begingroup\$ Cracked! That was fast. \$\endgroup\$ – Steven H. Nov 18 '16 at 21:59
0
\$\begingroup\$

C#, 91 bytes

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

Mathematica, 161 bytes

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

BrainFuck - 140 Bytes, Cracked by daHugLenny

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

Try It Here!

\$\endgroup\$
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – acrolith Nov 19 '16 at 16:03
0
\$\begingroup\$

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;
}
\$\endgroup\$
  • \$\begingroup\$ 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 \$\endgroup\$ – Karl Napf Nov 19 '16 at 13:45
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Peter Taylor Nov 19 '16 at 14:11
0
\$\begingroup\$

Mathematica, 34 bytes, Cracked

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

Named function (±).

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Martin Ender Nov 19 '16 at 10:16
  • \$\begingroup\$ Whoops, it's the first one, but I totally missed that rule... I'll change the code to fit the other one :) \$\endgroup\$ – JungHwan Min Nov 19 '16 at 16:01
  • \$\begingroup\$ Cracked then. ;) \$\endgroup\$ – Martin Ender Nov 19 '16 at 19:54
0
\$\begingroup\$

Ruby, 50 bytes

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

output: 400

\$\endgroup\$
0
\$\begingroup\$

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!"

\$\endgroup\$
  • \$\begingroup\$ Are all three inputs strictly necessary? Could this still work if you hard code one (or more) of the inputs? \$\endgroup\$ – Stewie Griffin Nov 21 '16 at 13:21
  • \$\begingroup\$ @StewieGriffin Yes. The questions explicitly requires three inputs; as well in the text as well as in the test cases. \$\endgroup\$ – agtoever Nov 21 '16 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.