45
\$\begingroup\$

This is the companion thread to the main Unscramble the Source Code challenge. If you think you have managed to unscramble one of the cop answers, you should post your solution as the answer to this thread.

As a reminder, you have one attempt at cracking each submission. Your cracking attempt will be an unscrambled version of the source code. If your guess matches the description (same characters, output, and of course language), and you are the first correct guess, then you win a point. It is important to note that your program does not have to exactly match the original, simply use the same characters and have the same functionality. This means there could be more than one correct answer.

The robber with the most points (successful cracks) wins.

Leaderboard

Too many solves

20 solves

15 solves

10 solves

7 solves

5 solves

4 solves

3 solves

2 solves

1 solve

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Perl 5, size 27, by Morot - print'pin'=~tr(a-za)(za-z)r \$\endgroup\$ Commented Nov 6, 2014 at 14:34
  • \$\begingroup\$ @WumpusQ.Wumbley We've all been there... ;) \$\endgroup\$ Commented Nov 6, 2014 at 14:35
  • 3
    \$\begingroup\$ I refuse to waste my time attempting to appease it. \$\endgroup\$ Commented Nov 6, 2014 at 14:35
  • \$\begingroup\$ Given the two question bodies, it appears that the scrambled/unscrambled answers are reversed \$\endgroup\$ Commented Nov 6, 2014 at 23:31
  • \$\begingroup\$ Ruby, 23 by MegaTom = p %++.methods[80][1..-1] \$\endgroup\$ Commented Nov 11, 2014 at 22:31

183 Answers 183

1
3 4
5
6 7
2
\$\begingroup\$

Ruby, 23 by MegaTom

p %++.methods[80][1..-1] 

Edit: So that's where the answer went. Converting back to an answer, hopefully. Thanks for specifying an interpreter, methods[80] is definitely version- and implementation- dependent. Using + for the percent-string delimiter is a nice touch.

I think I found this easier than I would've just because I'd been thinking of doing some similar tricks.

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

Ruby, size 17, by Stephen Touset

$><<$-W?$?:$:>-pi 

Test it on ideone.

Most certainly not the original code. $-W is the value of the command-line argument -W (warning level) which defaults to 1. The rest is just to get rid of the other characters, so I'm putting some undefined variables and operators in the else branch of a ternary.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ My original was $-p??:>$i:$><<$-W. I wanted to use the $><< trick, and the (very not well-known) flag-based globals like $-W. Unfortunately, that's short enough (7 characters) to be easily brute-forceable. I rationalized that it might be tricky to include the letter p as a red herring, and the rest was there to reduce the effectiveness of brute force. \$\endgroup\$ Commented Nov 13, 2014 at 19:32
2
\$\begingroup\$

Python, 45, by muddyfish

print(eval((chr(32)+chr(45)).join(str(413)))) 

Interesting idea, I have to say. Wasn't hard to brute force though.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I ended up with print(chr(int(45+3.)))or((((acehjlrsv1234)))). I think yours looks a bit neater :-) \$\endgroup\$ Commented Nov 14, 2014 at 2:55
2
\$\begingroup\$

Python, 37, MrWonderful

print 4123.*3 " +++3:==deefinorsuu" 

Probably not intended solution, but this solution is so obvious that I can't help.

Python 2 assumed.

\$\endgroup\$
1
  • \$\begingroup\$ That was not, in fact, the original code, but it is close enough. I commend your brevity! ;-) \$\endgroup\$ Commented Nov 14, 2014 at 17:51
2
\$\begingroup\$

J, 25, Caridorc

echo 3%##++-/-/i.!/i.3345 

There has to be many ways of getting rid of the extra characters...

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

C, 19, by Olavi Mustanoja

int main;retunr(){} 

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

C - size 33, by Olavi Mustanoja

#define p 2+57 main(){return p*p;} 

Returns 2 + (57*2) + 57 = 173

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

Javascript, 35 (36?), by user3863227

Too easy. After I took out Math and alert, log was the only option.

l=Math.log;alert(l(l(l(1234))));1279 

(By the way, I counted 36 characters, not 35.)

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

JavaScript, 10, by Jamie Barker

btoa(self) 

There weren't that many options...

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

PHP, size 46, by Ismael Miguel

$i=az;echo++$i,nd;$i[((E<<H)<=$m&oorrYYz)^$f]; 

Quite sure this isn't the intended solution.

Turning off notices is recommended for running this.

$i is first set to az, then incremented, which yields ba.

echo can take a list of strings to print; here it prints $i(ba), and then nd.

The rest of the code ($i[((E<<H)<=$m&oorrYYz)^$f];) does nothing.

\$\endgroup\$
5
  • \$\begingroup\$ Nice one! At the moment, I don't have the solution I had. The coma (, char) was my mistake on this one. I used it to make a "pretty" runnable scrambled code. In 40m I post the intended answer. \$\endgroup\$ Commented Nov 10, 2014 at 12:55
  • \$\begingroup\$ I'm sorry for the delay in providing the answer I had. I completely forgot when I went home for lunch. \$\endgroup\$ Commented Nov 10, 2014 at 16:10
  • \$\begingroup\$ This was the intended code: for($z=rand,$i=H<<EY;$i<(m^Y);)echo$z[$i++]&o;. \$\endgroup\$ Commented Nov 10, 2014 at 20:29
  • \$\begingroup\$ Greetings dude. After all this time, I've noticed you misspelled my name. Can you please fix it? \$\endgroup\$ Commented Jan 11, 2015 at 22:59
  • \$\begingroup\$ @IsmaelMiguel Sorry about that, fixed. \$\endgroup\$ Commented Jan 11, 2015 at 23:01
1
\$\begingroup\$

Lua, size 18, by user3155415

print(3<math.huge) 

I actually haven't tested this, but it should work.

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

Python, size 68, by horns

o=ord;print(chr(35),o('{'),o("-"),o("C"),o("Y"),sep="")#''''"02blpst 

I think I've got the characters right. Either way, if I miscounted the number of quotes, the rest go after the comment (consulting the ASCII table helped).

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

CJam, size 52, by user23013

33,33,33f+:cm*33)%",,,:::')@\&++++3333333333cfffff"; 

Test it here.

Thanks for providing "...";. ;)

\$\endgroup\$
1
  • \$\begingroup\$ The intended solution was 33,33,33f+:c)",,,fffff:::'&"+;+33*33%33\33@33)m33++c. (Note that it has two redundant 3s.) Using m instead of - seemed to be a bad choice. And yes, those ,:fs are supposed to be only misleading. \$\endgroup\$ Commented Nov 5, 2014 at 9:19
1
\$\begingroup\$

PHP, size 13, by kenorb

@die(_(abc)); 

I have no idea what _(...) does. Now I do.

\$\endgroup\$
1
  • \$\begingroup\$ Me either (re: _). The org was: die(_(@abc));, you're too quick. \$\endgroup\$ Commented Nov 5, 2014 at 14:44
1
\$\begingroup\$

Python 2, size 57, by FryAmTheEggman

print''.join(map(chr,(40+58,90+4+10+0b100,113+4,101++0))) 

The ++ is a lazy way to get rid of a +.

\$\endgroup\$
1
  • \$\begingroup\$ Nice work! This was the original: print''.join(map(chr,(0140+0b10,0143+9,0105+48,++++101)) \$\endgroup\$ Commented Nov 5, 2014 at 21:08
1
\$\begingroup\$

Mathematica, size 35, by Tally

$PrePrint=$Pre=e=p=esPrint&'' ;a 

Definitely not unique. Basically, I'm creating a constant function, take the second derivative (which is a constant-0 function) and make sure that function is applied to any expression that is evaluated or printed. Then I evaluate a.

\$\endgroup\$
1
  • \$\begingroup\$ Yeah, I figured it probably wasn't unique... Still it was fun to try and mess with parts of mathematica I hardly understand. My code was: $PrePrint = e = s' &; $PrePrint = p = e' \$\endgroup\$ Commented Nov 6, 2014 at 2:26
1
\$\begingroup\$

Brainfuck, size 118, Sp3000

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

Brainfuck is really not so bad, as long as it's not golfed too much. Since the alphabet is so limited, you can write whatever program you want as long as it's shorter than the original, and then make slight adjustments to balance the symbol counts.

\$\endgroup\$
1
  • \$\begingroup\$ Indeed :) Maybe I should have made the string longer, but I'm not sure how much that would have helped. Didn't want the program to be too long though. \$\endgroup\$ Commented Nov 6, 2014 at 9:58
1
\$\begingroup\$

JavaScript, size 25, by Cris

alert.apply(self,[alert]) 
\$\endgroup\$
1
\$\begingroup\$

JavaScript, size 29, by Cris

new Event("flushPs15").CHANGE 

Works in the console.

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

PHP, size 27, by kenorb

$_=hex2bin(7069);die($_()); 

(hex2bin(7069) evaluates to "pi" which is then called)

\$\endgroup\$
1
  • \$\begingroup\$ @kenorb woops, that was badly copied. \$\endgroup\$ Commented Nov 6, 2014 at 17:14
1
\$\begingroup\$

Mathematica, size 29, by Fox Wilson

$PrePrint=Function[{x},5]; 2+2 

Learned something new today! :) ($PrePrint)

\$\endgroup\$
4
  • \$\begingroup\$ You're missing a pair of curly braces, but it's pretty obvious where they go (around the x in the Function definition) -- hopefully OP won't mind. \$\endgroup\$ Commented Nov 4, 2014 at 22:05
  • \$\begingroup\$ @FoxWilson Oh, sorry, thanks for letting me know! (They can also go around anything in the final line, or the entire first statement.) \$\endgroup\$ Commented Nov 4, 2014 at 22:09
  • \$\begingroup\$ todat? today? \$\endgroup\$ Commented Nov 6, 2014 at 18:05
  • \$\begingroup\$ @TRiG I have no idea what you're talking about. ;) \$\endgroup\$ Commented Nov 6, 2014 at 18:06
1
\$\begingroup\$

C, size 28, Mig

main(s){s=2189640;puts(&s);} 

Depends on the endianness of the system.

\$\endgroup\$
6
  • \$\begingroup\$ Lorem ipsum dolor sit what now? \$\endgroup\$ Commented Nov 6, 2014 at 16:11
  • \$\begingroup\$ Validated here : ideone.com/xpokuO \$\endgroup\$ Commented Nov 6, 2014 at 16:13
  • \$\begingroup\$ @squeamishossifrage It's probably Bayesian poisoning. \$\endgroup\$ Commented Nov 6, 2014 at 19:37
  • \$\begingroup\$ @feersum If you don't pasting any rubbish into your posts intentionally, please check your computer for any viruses or adwares. \$\endgroup\$ Commented Nov 6, 2014 at 19:45
  • 1
    \$\begingroup\$ @kenorb He was probably trying the avoiding rivers problem as well :D \$\endgroup\$ Commented Nov 6, 2014 at 19:53
1
\$\begingroup\$

JavaScript, size 26, by Cris

eval("new function $(){}") 

Tested in Chrome's console.

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

Java, size 226, nhhhhtdh

enum u{u;public static void main(String...a){ System.out.print(0x17+68+"\u0020\125nmatched closing \u0027)\u0027u\"((()),.00008;DEIPP\\aaaaaaaacccceeeeeeeeefgiiijlnnooppprrrrrsstttttttttuuuvxyyz{{}}".split(u.toString())[0]);}} 

A quick search revealed that it was easy to generate a PatternSyntaxException with the message Unmatched closing ')', but it proved to be unnecessary as the abundance of backslashes, us and digits allowed me to create any character I didn't have via escapes.

\$\endgroup\$
1
  • \$\begingroup\$ Not the intended solution, but I did expected it to be cracked in other ways. Maybe I shouldn't have used too many \ \$\endgroup\$ Commented Nov 7, 2014 at 8:47
1
\$\begingroup\$

Python 2, size 89, Beta Decay

 ''''''''((()))*,,,,...12;;=BFGGIIIILPRaaaaaabceeeeeeffgggggiiiiiklmmmmmmnnoopprrrsttvw 

Really I would recommend to output something........

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

JavaScript, size 30, by Qwertiy

with(Math)alert(max^min) 

Interesting use for with. :)

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

JavaScript, 41 bytes, by Ismael Miguel

(function(){return this})('ccnoorrsttu.') 

Tested in Chrome's console.

\$\endgroup\$
1
  • \$\begingroup\$ This wasn't what I had in mind, but was this function(){}.constructor('return this')(). I guess it was too easy. \$\endgroup\$ Commented Nov 8, 2014 at 11:43
1
\$\begingroup\$

PHP, size 80, by Ismael Miguel

priNt(a^Z^P^Q);$A^=$A^=$C+=$F.=($I^$I^$O<$PTTUWWXX______________aaabffjkory);;;; 

There are many ways to get a short output like :.

\$\endgroup\$
1
  • \$\begingroup\$ Well, I had this source code: $__=NZrkPi^jAtFbW^TIOCfX;for($_=aa^WU;$_<AIa^pyQ;$_+=a^P)$___.=$_^T^X;$__($___);. Completely forgot to remove the priNt chars :/ This was a serious breach. I will have more careful next time. But nice one! \$\endgroup\$ Commented Nov 9, 2014 at 7:27
1
\$\begingroup\$

QBasic, 43 bytes, by DLosc

DATA? DIM P AS STRING READ P ?P;P;CEEEEH36$ 
\$\endgroup\$
1
\$\begingroup\$

ECMAScript, 90 bytes, by Cris

(function(t){t.n=t;t.n(t.n.FFFbcdeehhiiiinooopprrrsstuuy)}) ((function(){alert(this+"")})) 

The original solution is probably (based on Martin Büttner's work in the chat):

Function.prototype.F=function(){return this.bind(this)()};(function(){alert(this+"")}).F() 
\$\endgroup\$
1
  • \$\begingroup\$ Lol, nice workaround! :) \$\endgroup\$ Commented Nov 9, 2014 at 18:59
1
3 4
5
6 7

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.