44
\$\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\$
    – user15244
    Nov 6, 2014 at 14:34
  • \$\begingroup\$ @WumpusQ.Wumbley We've all been there... ;) \$\endgroup\$ Nov 6, 2014 at 14:35
  • 3
    \$\begingroup\$ I refuse to waste my time attempting to appease it. \$\endgroup\$
    – user15244
    Nov 6, 2014 at 14:35
  • \$\begingroup\$ Given the two question bodies, it appears that the scrambled/unscrambled answers are reversed \$\endgroup\$ Nov 6, 2014 at 23:31
  • \$\begingroup\$ Ruby, 23 by MegaTom = p %++.methods[80][1..-1] \$\endgroup\$
    – histocrat
    Nov 11, 2014 at 22:31

182 Answers 182

1
3 4
5
6 7
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\$ 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\$ 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\$ 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\$ 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\$ Jan 11, 2015 at 22:59
  • \$\begingroup\$ @IsmaelMiguel Sorry about that, fixed. \$\endgroup\$
    – es1024
    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\$
    – jimmy23013
    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\$
    – kenorb
    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\$ 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\$
    – Tally
    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\$
    – Sp3000
    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\$
    – bwoebi
    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\$ 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\$ Nov 4, 2014 at 22:09
  • \$\begingroup\$ todat? today? \$\endgroup\$
    – TRiG
    Nov 6, 2014 at 18:05
  • \$\begingroup\$ @TRiG I have no idea what you're talking about. ;) \$\endgroup\$ 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\$
    – r3mainer
    Nov 6, 2014 at 16:11
  • \$\begingroup\$ Validated here : ideone.com/xpokuO \$\endgroup\$
    – Michael M.
    Nov 6, 2014 at 16:13
  • \$\begingroup\$ @squeamishossifrage It's probably Bayesian poisoning. \$\endgroup\$
    – kenorb
    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\$
    – kenorb
    Nov 6, 2014 at 19:45
  • 1
    \$\begingroup\$ @kenorb He was probably trying the avoiding rivers problem as well :D \$\endgroup\$
    – Optimizer
    Nov 6, 2014 at 19:53
1
\$\begingroup\$

JavaScript, size 26, by Cris

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

Tested in Chrome's console.

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

Python 3, size 46, hosch250

(print("'(otlotb)'")
==
'bffiilnnoopprrrr01*')

I don't think the idea is to let me simply print the output string in a plain literal...

\$\endgroup\$
2
  • \$\begingroup\$ This is my original program: f=bool;prin="'(otlotb)'"*f('01');print(prin). Replace the ; with newlines. \$\endgroup\$
    – user10766
    Nov 7, 2014 at 2:02
  • \$\begingroup\$ BTW, user23013 is correct - you need to move your parenthesis from the garbage statement to the output statement. \$\endgroup\$
    – user10766
    Nov 7, 2014 at 2:03
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
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\$ 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\$ 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\$ Nov 9, 2014 at 18:59
1
\$\begingroup\$

PHP, 33 bytes, by Ismael Miguel

echo  0X1^BXcdeilnu08DFHTTTgk467;

Tested on ideone.

This might actually also work on Windows. All it does is xor a hexadecimal 1 with an undefined constant which yields 0.

For the Windows one you can use

echo  7^'6cdeilnudBXX4';

which should also work on both platforms, because the string is simply coerced into an integer (being 6), and then we xor that with 7.

I'm curious what those were supposed to be.

\$\endgroup\$
5
  • \$\begingroup\$ Linux: PHP Parse error: syntax error, unexpected 'Xdeilnu0018DFHTTTgk' (T_STRING), expecting ',' or ';' in /home/gn2Uey/prog.php on line 2 but the windows is correct. But really nice try! \$\endgroup\$ Nov 9, 2014 at 22:24
  • \$\begingroup\$ @IsmaelMiguel sorry, the link is wrong, but if you use the code in my answer it works. I've fixed the link now. \$\endgroup\$ Nov 9, 2014 at 22:28
  • \$\begingroup\$ writecodeonline.com/php -> runs fine here. But yeah, you cracked it. My mistake was leaving the 1 in the code. The code I has is this: Linux: echo include H010D67XT^gTTFkXB48;. Windows: echo include '67X'^XB4; \$\endgroup\$ Nov 9, 2014 at 22:31
  • \$\begingroup\$ @IsmaelMiguel Wow, I must have been blind, I did not see that the lowercase letters spell include. \$\endgroup\$ Nov 9, 2014 at 22:37
  • \$\begingroup\$ And I didn't see I left that 1 behind. But it was really a nice catch! \$\endgroup\$ Nov 9, 2014 at 22:43
1
\$\begingroup\$

QBasic, 79 bytes, by DLosc

print"Iodine"
if f then scReen         BLaaabbefgghhhiiiiiiiikkllnnossstt,u-u.u
\$\endgroup\$
1
3 4
5
6 7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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