Two Makes All The Difference - Cops

60

10

NOTICE - This challenge is now closed. Any new answers will be ignored and the accepted answer will not change

Challenge

Write a valid program which, when just two characters in the program are changed, removed or added, completely changes the output.

The changed output must have a Levenshtein Distance of 15 or more from your original output.

The output must be non empty and finite. Your program therefore must terminate within 1 minute.

Your output must be deterministic, outputting the same thing each time you run the program. It also must not be platform dependent.

Any hash functions are disallowed, as are built in PRNGs. Similarly, seeding an RNG is not allowed.

After a period of three days, an uncracked submission will become safe. In order to claim this safety, you should edit your answer to show the correct answer. (Clarification: Until you reveal the answer, you are not safe and can still be cracked.)

Formatting

Your answer should be in the following format:

# <Language name>, <Program length>

## Code

<code goes here>

## Original Output

<output goes here>

## Changed output

<changed output goes here>

Robbers

The robbers' challenge is to find out which two characters you have changed. If a robber has cracked your solution, they will leave a comment on your answer.

You can find the robbers' thread here.

Winning

The person with the shortest uncracked solution wins.

Leaderboard

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script>site = 'meta.codegolf';postID = 5686;isAnswer = false;QUESTION_ID = 54464;var safe_list=[];var uncracked_list=[];var n=0;var bycreation=function(x,y){return (x[0][0]<y[0][0])-(x[0][0]>y[0][0]);};var bylength=function(x,y){return (x[0][1]>y[0][1])-(x[0][1]<y[0][1]);};function u(l,o){ jQuery(l[1]).empty(); l[0].sort(o); for(var i=0;i<l[0].length;i++) l[0][i][1].appendTo(l[1]); if(l[0].length==0) jQuery('<tr><td colspan="3" class="message">none yet.</td></tr>').appendTo(l[1]);}function g(p) { jQuery.getJSON('//api.stackexchange.com/2.2/questions/' + QUESTION_ID + '/answers?page=' + p + '&pagesize=100&order=desc&sort=creation&site=codegolf&filter=!.Fjs-H6J36w0DtV5A_ZMzR7bRqt1e', function(s) { s.items.map(function(a) { var he = jQuery('<div/>').html(a.body).children().first(); he.find('strike').text(''); var h = he.text(); if (!/cracked/i.test(h) && (typeof a.comments == 'undefined' || a.comments.filter(function(b) { var c = jQuery('<div/>').html(b.body); return /^cracked/i.test(c.text()) || c.find('a').filter(function() { return /cracked/i.test(jQuery(this).text()) }).length > 0 }).length == 0)) { var m = /^\s*((?:[^,;(\s]|\s+[^-,;(\s])+)\s*(?:[,;(]|\s-).*?([0-9]+)/.exec(h); var e = [[n++, m ? parseInt(m[2]) : null], jQuery('<tr/>').append( jQuery('<td/>').append( jQuery('<a/>').text(m ? m[1] : h).attr('href', a.link)), jQuery('<td class="score"/>').text(m ? m[2] : '?'), jQuery('<td/>').append( jQuery('<a/>').text(a.owner.display_name).attr('href', a.owner.link)) )]; if(/safe/i.test(h)) safe_list.push(e); else uncracked_list.push(e); } }); if (s.length == 100) g(p + 1); else { var s=[[uncracked_list, '#uncracked'], [safe_list, '#safe']]; for(var p=0;p<2;p++) u(s[p],bylength); jQuery('#uncracked_by_length').bind('click',function(){u(s[0],bylength);return false}); jQuery('#uncracked_by_creation').bind('click',function(){u(s[0],bycreation);return false}); } });}g(1);</script><link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"><style>table th,table td { padding: 5px;}th { text-align: left;}.score { text-align: right;}table a { display: block;}.main { float: left; margin-right: 30px;}.main h3,.main div { margin: 5px;}.message { font-style: italic;}</style><div class="main"><h3>Uncracked submissions</h3><table> <tr> <th>Language</th> <th class="score">Length</th> <th>User</th> </tr> <tbody id="uncracked"></tbody></table><div>Sort by: <a href="#" id="uncracked_by_length">length</a> <a href="#" id="uncracked_by_creation">creation</a></div></div><div class="main"><h3>Safe submissions</h3><table> <tr> <th>Language</th> <th class="score">Length</th> <th>User</th> </tr> <tbody id="safe"></tbody></table></div>

Beta Decay

Posted 2015-08-11T08:11:19.767

Reputation: 21 478

@BetaDecay How do you define a hash function? – isaacg – 2015-08-11T08:47:08.947

Can't one brute force every possible change? – xnor – 2015-08-11T08:47:26.917

1@xnor Theoretically, but the number of possibilities increases hugely as the program length increases and so may take a long time – Beta Decay – 2015-08-11T08:48:46.443

@isaacg A function which finds the hash value of an object

– Beta Decay – 2015-08-11T08:54:31.023

@BetaDecay I think the problem might be that the shortest uncracked solution is the winner but the shortest solutions are also the easiest to brute force – Fatalize – 2015-08-11T09:28:28.923

I so want to do a very long brainfuck one just to laugh while people get crazy.. – RedPanda – 2015-08-11T10:19:05.290

@RedPanda Go for it ;) – Beta Decay – 2015-08-11T10:19:34.617

I guess changing the place of a character counts as one removed + one added? – RedPanda – 2015-08-11T10:27:12.250

1@RedPanda Yes, I would think so – Beta Decay – 2015-08-11T10:34:23.970

Just to clarify, must the program always have the same output if any two characters are changed other than the chosen two? Or just that the desired new output is only achieved by changing those two characters? – StephenTG – 2015-08-11T12:55:06.943

@StephenTG Not the OP, but I would assume that as long as you can get the same output, the crack is valid even if it's not the exact same changes as the poster. Or at least that's the case with most other cops and robbers. – Sp3000 – 2015-08-11T13:07:52.867

Do you have to change 2 characters? Can I only change 1 character if I want to? – Blue – 2015-08-11T13:17:19.177

@BetaDecay How long until submissions are safe? – Dennis – 2015-08-11T16:35:58.893

@Dennis One day – Beta Decay – 2015-08-11T18:34:46.780

@muddyfish No, it has to be 2 characters – Beta Decay – 2015-08-11T18:51:46.243

@BetaDecay So, If a submission goes uncracked for 24 hours, should the poster post the solution to make it safe? If so, can you add that to the OP? – isaacg – 2015-08-12T07:26:41.887

5@isaacg I decided to change the safe date to three days – Beta Decay – 2015-08-12T07:37:03.613

@StewieGriffin Nope – Beta Decay – 2015-08-12T13:37:00.333

@StewieGriffin Yes, of course :) have a look at isaacg's many answets – Beta Decay – 2015-08-12T14:25:38.853

4Would it be possible to put the leaderboard code on fewer lines so it takes up less visual room? – isaacg – 2015-08-13T00:49:53.850

The brainfuck code by kurousagi was cracked a long time ago... Someone should update it – AboveFire – 2015-08-13T11:44:01.233

@AboveFire Until Kurousagi acknowledges the crack, we can't make the snippet change unfortunately – Beta Decay – 2015-08-13T11:49:45.027

@AboveFire Was it cracked with the correct unprintables? Last we heard he was going to find a way to add the unprintables or something to that effect, then, radio silence. – Alex Van Liew – 2015-08-13T17:10:18.937

Brute forcing has complexity O(N^2), although the constant can admittedly be pretty large. – jcai – 2015-08-13T17:38:40.127

"No, it has to be 2 characters" In that case, would adding a single space plus one "real" change be allowed? In most programming languages whitespace is insignificant, so one can easily go from "2 characters" to "1 [effective] character" if this is allowed.

– mgibsonbr – 2015-08-13T18:13:48.013

I want to do this in Marbelous. – Not that Charles – 2015-08-14T18:24:44.310

"No, it has to be 2 characters" - There's a woolly thing. One removal, and one adjacent insert effectively changes one char. One change and one adjacent removal effectively removes one char. One add and one adjacent replacement effectively adds one char. So, at least until rules are clarified to exclude this loophole, I'd argue that you can effectively affect only one character, so long as you CALL it two characters. – Dewi Morgan – 2015-08-15T06:33:51.787

Answers

6

CJam, 13 bytes (safe)

J{m!_)mQ%2b}/

Try it online.

Original output

000010010101001010001101111000111011100110100100001011101101010100011111110010010010001111111111010000010011001110001010011111000010001001110111100000010110000010000111011011110101110010000011100111100

Modified output

11101101100011110001011010000100111011000010011101100000001010100111011010011011010111101000000011101111100000000110001000111110110110101111110100101110000101110100110011110000010101110

Solution

J{m!_)ci%2b}/

Try it online.

How it works

This takes advantage of how CJam implicitly prints the entire stack after executing the program.

Simply dumping the base-2 representations of a few integers on the stack causes them to be printed without any separator, so it should be hard to figure out where one of them begins and another one ends.

The original code does the following:

J{   e# For each I from 0 to 18, do the following:
  m! e#   Calculate the factorial of I.
  _) e#   Push a copy and add 1.
  mQ e#   Compute the result's integer square root.
  %  e#   Calculate the residue of the factorial divided by the square root.
  2b e#   Push the array of base 2-digits of the resulting integer.
}/   e#

As @AndreaBiondo notes in the comments, the binary representations of 0! to 8! can be found at the beginning of the output (spaces added for clarity):

1 1 10 110 11000 1111000 1011010000 1001110110000 1001110110000000

The intended change was to replace mQ with ci, which takes the integer modulo 65536, using 16-bit character arithmetic (casting to an unsigned 16-bit character, then back to integer).

I hoped the idea of using c to replace a mathematical operator would be obscure enough.

Dennis

Posted 2015-08-11T08:11:19.767

Reputation: 196 637

Wow. How do you come up with this? – The_Basset_Hound – 2015-08-12T21:29:36.280

I tried to crack this for quite a while. I figured out part of the modified pattern, but I was missing something. It's safe now I guess. – Andrea Biondo – 2015-08-15T18:52:45.547

@AndreaBiondo It is now. Thanks for reminding me. – Dennis – 2015-08-15T19:27:28.393

@Dennis I had figured out that _)mQ needed to be changed to an f(x!) such that f(x!) > x! for x <= 8 and f(x!) < x! for x >= 9, because x! was obviously being modulo'ed by a number that left the factorials from 0 to 8 intact in the output. I didn't notice 9! was the first factorial bigger than 2^16. Very nice challenge anyway. – Andrea Biondo – 2015-08-15T21:33:45.087

39

Cracked

Shakespeare, 1721 bytes

I tried a Shakespeare answer. It is not short, and I had difficulties to change the output with only 2 characters, but I think I succeeded quite well. Good Luck everybody. As a side note, I used the "compiler" available at this address and it may not work with another one. (it does not work with the online interpreter) The output does not contain any unprintable characters.

Code

The Hidden Change.

Helen, a young woman with a remarkable patience.
Helena, a likewise young woman of remarkable grace.
Claudio, a remarkable man much in dispute with Claudius.
Claudius, the flatterer.
The Archbishop of Canterbury, the useless.


          Act I: Claudius's insults and flattery.

          Scene I: The insulting of Helen.

[Enter Claudius and Helen]

Claudius:
 Thou art as hairy as the sum of a disgusting horrible fatherless 
 dusty old rotten fat-kidneyed cat and a big dirty cursed war.
 Thou art as stupid as the product of thee and a fat smelly 
 half-witted dirty miserable vile weak son.

[Exeunt]

          Scene II: The complimenting of Helena.

[Enter Claudio and Helena]

Claudio:
 Thou art the sunny amazing proud healthy peaceful sweet joy.
 Thou art as amazing as the product of thee and the pretty
 lovely young gentle handsome rich Hero. Thou art as great 
 as the sum of thee and the product of a fair golden prompt good honest 
 charming loving noble king and a embroidered rich smooth golden angel.

[Exeunt]

          Scene III: The insulting of Claudio

[Enter Claudius and Helen]

Helen:
 Thou art as stupid as the sum of the sum of thee and a cat and me.
[Exit Helen]

[Enter Claudio]

Claudius:
 Thou art as stupid as the sum of thee and the product of the 
 product of me and Helen and Helena

[Exeunt]

          Scene IV: The Final Countdown

[Enter The Archbishop of Canterbury and Claudius]

Claudius:
 Thou art the sum of you and a cat.

The Archbishop of Canterbury:
 Am I better than a fine road?

Claudius:
 If not, let us return to the insulting of Claudio.

[Exit The Archbishop of Canterbury]

[Enter Claudio]

Claudius:
 Open your heart!
 Open your heart!
[Exeunt]

Original Output

11324620811132462081

Changed Output

11

AboveFire

Posted 2015-08-11T08:11:19.767

Reputation: 623

9Truly marvelous. This story brought tears to my eyes. – Alex Van Liew – 2015-08-12T23:01:33.483

6@AlexVanLiew It took me a really long time to write. It is my masterpiece! – AboveFire – 2015-08-12T23:14:53.187

1Cracked! – plannapus – 2015-08-13T15:40:39.083

Very Nice answer – proud haskeller – 2015-08-15T20:20:30.337

24

J, 76 bytes (safe)

Code

,:|.,.<,:>><|.,:>,.<|.>,:<<|.>|.,:,.<,.<,:,.<,:>|.<,:>,.|.<,:,.|.<<,:>126$a.

Original Output

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐│
││┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐││
│││┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐│││
││││┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐││││
│││││     ┌┬┐├┼┤└┴┘│─ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}│││││
││││└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘││││
│││└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘│││
││└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘││
│└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘│
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Changed output

┌──────────────────────┐
│┌────────────────────┐│
││┌──────────────────┐││
│││┌────────────────┐│││
││││┌──────────────┐││││
│││││┌───────────┬┐│││││
││││││0 0 0 0 0 0│││││││
│││││└───────────┴┘│││││
││││└──────────────┘││││
│││└────────────────┘│││
││└──────────────────┘││
│└────────────────────┘│
└──────────────────────┘

EDIT: Solution {: added (shown between ###)

,:|.,.<,:>><|.,:>,.<|.>,:<<|.>|.,:,.<,.<,:,.<,###{:###:>|.<,:>,.|.<,:,.|.<<,:>126$a.

Makes use of the monad {:: Map. Most of the rest of the code is useless garbage.

Fatalize

Posted 2015-08-11T08:11:19.767

Reputation: 32 976

Note that I could certainly extend the code by a ridiculous amount of characters to make it harder to find the spot(s) where the two characters need to be added/removed/changed – Fatalize – 2015-08-11T09:21:33.493

I think it's been 3 days for this one, so if you post the answer, you're safe. – isaacg – 2015-08-14T20:01:30.597

@isaacg Correct, edited the answer – Fatalize – 2015-08-14T20:26:20.507

12

Cracked

Ruby, 14

Code

x=9;puts x*9*9

Original Output

729

Changed output

99999999999999999

histocrat

Posted 2015-08-11T08:11:19.767

Reputation: 20 600

4This looks so innocent. I've tried and I've tried, but I don't know where to get the 17 from... – Dennis – 2015-08-11T21:58:15.033

1I thought it was 18 9s, so I was going for something like '99'*2. wc, you betrayed me! – Alex Van Liew – 2015-08-11T22:33:31.570

@AlexVanLiew 18 would be easy. Blame your shell for appending a linefeed. – Dennis – 2015-08-11T22:37:29.650

@Dennis How would you do it with 18? I couldn't figure it out (but I also don't know Ruby). – Alex Van Liew – 2015-08-11T22:39:24.110

@AlexVanLiew x=?9;puts x*2*9 – Dennis – 2015-08-11T22:44:21.737

@Dennis Aha, does ? mean "start of character literal"? I knew there had to be something in there for that, but I couldn't find it. – Alex Van Liew – 2015-08-11T23:01:04.523

6Cracked – Razvan – 2015-08-12T16:29:30.760

12

Cracked

Bash, 15 bytes

echo {{{1..9}}}

Original output

{{1}} {{2}} {{3}} {{4}} {{5}} {{6}} {{7}} {{8}} {{9}}

Modified output

1 2 3 4 5 6 7 8 9

Dennis

Posted 2015-08-11T08:11:19.767

Reputation: 196 637

Cracked – samgak – 2015-08-12T02:57:26.643

2Well done. This lasted longer than I thought it would. – Dennis – 2015-08-12T02:59:13.950

10

Cracked

Python 2, 43 bytes

Code

print (sum(range(054321)*9876)*87654)/01234

Original Output

334960491355406

Changed output

222084148077792

The Levenshtein Distance is 15 exactly. Both the original and the changed run under 1 minute on my computer.

Blue

Posted 2015-08-11T08:11:19.767

Reputation: 26 661

1I've edited your post to reflect that this is a Python 2-specific submission, due to the missing parentheses for print and the multiplication of range by an integer. However, I seem to be getting MemoryErrors from the large list... – Sp3000 – 2015-08-11T11:27:05.277

Sorry, yes it is python 2, the most memory it uses on my computer is 1.61GB, is that really too much? – Blue – 2015-08-11T11:49:16.993

No, it's all good. My computer's just a bit low of memory and I wasn't sure how much it used. – Sp3000 – 2015-08-11T11:50:44.027

1Since this isn't code golf, you could reduce the memory load by using xrange instead of range and I believe itertools has a generator-builder that repeats a sequence x number of times. – Alex Van Liew – 2015-08-11T16:43:58.137

1@AlexVanLiew But the scoring is code-golf in a sense, shortest uncracked. Having said that though, there's an unnecessary space and pair of parens... or are they necessary? ;) – Sp3000 – 2015-08-11T16:46:35.880

Oh, I didn't notice shortest uncracked. Sure. – Alex Van Liew – 2015-08-11T16:49:07.177

Oh man, I didn't notice that you could change, add, or remove two characters. I was working on this but ugh, I don't want to play with numbers like that. – Alex Van Liew – 2015-08-11T16:53:20.700

2IMO this answer seems kind of not interesting if this relies only on changing the numbers involved (we don't know if this is the case), because in that case you can probably do shorter and the only way it will ever get cracked is just by brute force, not cleverness. – Fatalize – 2015-08-11T18:13:10.797

Changing range to xrange breaks it on my computer - py2.7. (Thats the original, i didnt test it with the changed). It might not for py3 but i cant tell if the changed stuff will be the same in py3 because i dont have it – Blue – 2015-08-11T19:36:07.887

@muddyfish: xrange returns a generator, so multiplying it by a number won't work in py2.7. However, you can achieve the same result with one more character: print (sum(xrange(054321))*9876*87654)/01234 (note the moved paren). It also computes almost instantly on a weak machine I was testing on, whereas prior it threw MemoryError. You don't have to change it by any means (and for all we know it breaks the changed version) but if it still works fine it would help a bit. – Alex Van Liew – 2015-08-11T19:42:09.550

1The octal numbers are clever, though. – Alex Van Liew – 2015-08-11T19:42:44.777

No, it doesn't break it by making the change you made. By changing (or adding/removing) 2 chars in that version, you can still get the same output – Blue – 2015-08-11T20:56:45.710

3Cracked. That was a fun one! – isaacg – 2015-08-12T02:49:30.670

10

Cracked

Prolog, 10 bytes

Code

X is 1/42.

Original Output

X = 0.023809523809523808.

Changed output

X = -2.

Fatalize

Posted 2015-08-11T08:11:19.767

Reputation: 32 976

Cracked – Sp3000 – 2015-08-11T15:13:54.270

2For some reason I totally overlooked the fact that this can also be solved like this: X is 1//4-2., which is a lot easier to see than my original solution that @sp3000 cracked... – Fatalize – 2015-08-12T21:07:04.023

8

Cracked

BrainFuck , 504 bytes

No one should ever need to analyse a brainfuck code. This is a modified version of an earlier code, but any change in a Brainfuck code make a big difference in the output. I use the Interpreter at http://esoteric.sange.fi/brainfuck/impl/interp/i.html to test my code. Good Luck !

Code

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

Original Output

 ___
/   \
|   |
\___/

Changed Output

}}}\}}}|.}}}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\\}}|.}.|///\

Note: The Changed Output contains several STX(ASCII 2) and EOT(ASCII 4) characters

Here is the version with ASCII codes in parenthesis instead of unprintable characters:

(2)}}}(2)\}}}|(2).}}}.(2)|///\\(4)}|(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)///\\(4)}}|(2).(4)}(4).(2)|///\\(4)}}(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)|/(4)/\\(4)}}|(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)|///\\(4)}}|(2).(4)}(4).(2)|///\

AboveFire

Posted 2015-08-11T08:11:19.767

Reputation: 623

3You are evil. But i will find it! – RedPanda – 2015-08-11T12:04:36.843

@RedPanda My code does have a structure. At least it's not random! Good luck! – AboveFire – 2015-08-11T12:25:49.140

are there any unprintables in the output? – proud haskeller – 2015-08-11T16:17:24.827

@proudhaskeller Yes sorry about that, I'll edit the post, there is a bunch of character STX(ASCII 2) and EOT(ASCII 4) – AboveFire – 2015-08-11T16:31:29.350

but where are they? i don't have the information – proud haskeller – 2015-08-11T16:35:57.537

@proudhaskeller I am working on it right now :) – AboveFire – 2015-08-11T16:37:38.930

your changed code without the unprintable characters starts with "}}}}}}", but the one with them starts with "(2)}}}(2)}}}", mssing the "". can you double check this? there may be errors in other parts too. – proud haskeller – 2015-08-11T19:14:00.010

@proudhaskeller I tried to use bold to make the chars clearer, but "" does not appear in a citation. Thanks for pointing this out – AboveFire – 2015-08-11T19:24:42.490

Let us continue this discussion in chat.

– proud haskeller – 2015-08-11T19:58:06.603

1

cracked http://codegolf.stackexchange.com/a/54515/20370

– proud haskeller – 2015-08-11T20:23:57.780

8

cracked

Wolfram Language (Mathematica or WolframAlpha), 3 bytes

Code

8.!

Original Output

40320.

Changed output

2.67182 - 0.891969 I

For those trying it on WolframAlpha the result shows up as

Mathematica graphics

I deleted my previous answer because it worked only on Mathematica and not in WolframAlpha. That put robbers behind a paywall (instead of the deserved bars), which wasn't fair.

Dr. belisarius

Posted 2015-08-11T08:11:19.767

Reputation: 5 345

@abligh Nice! :) – Dr. belisarius – 2015-08-13T17:21:56.393

1What was the answer of the other one? I am very curious. – Brain Guider – 2015-08-14T15:04:00.367

7

Cracked

CJam, 8 characters

Code

"~f":i:#

Original output

17290024234092933295664461412112060373713158853249678427974319674060504032816100667656743434803884485234668769970047274563123327020396104330878852891146011372048615474145637592955298601510765168228550988848615653376

Changed output

Output after modification is here. Both take under a minute on my 2GHz laptop.

Explanation

People seem amazed at how this works. The code works like this:

"~f"       Push a string
    :i     Convert to a list of bytes [126 102]
      :#   Fold with # (power)

This calculates 126^102. The solution was:

"}\t~f"
       :i     Convert to a list of bytes [125 9 126 102]
         :#   Fold with # (power)

This calculates ((125^9)^126)^102, which is hundreds of thousands of digits long.

Lynn

Posted 2015-08-11T08:11:19.767

Reputation: 55 648

6This is criminal. – Alex Van Liew – 2015-08-11T18:50:57.053

What the... I really wanna know how this works! ;) – Beta Decay – 2015-08-11T20:06:26.900

Cracked. – Dennis – 2015-08-11T20:07:23.120

@BetaDecay I could explain how the original works but not Dennis's version. I wonder how Mauris meant it to be solved... – Alex Van Liew – 2015-08-11T20:13:00.747

Holy bananas! WTF! – Brain Guider – 2015-08-14T15:01:22.637

7

Cracked

Pyth, 8 bytes

Code:

%CG^3y21

Initial Output:

51230235128920219893

Changed Output:

58227066

isaacg

Posted 2015-08-11T08:11:19.767

Reputation: 39 268

1The changed output equals CG mod (2^21 * 28). I don't know Pyth, so I can't see how to change (3 ^ (2 * 21)) into that... – Lynn – 2015-08-12T18:52:38.823

1Also, CG equals sum(256**n * (122-n) for n in range(26)). – Lynn – 2015-08-12T18:58:08.887

1The changed output also equals CG mod (2^21 * 28 * 2*n), where 1 <= n <= 4, as well as for n=6 and n=12. Also, CG is just the lowercase alphabet interpreted as a base 256 number. I wonder if there's another modulo with base 3? – Alex Van Liew – 2015-08-12T20:30:57.627

%CG^2 26 or %CG^4y13, but both have a distance of 3... – Jakube – 2015-08-14T09:27:01.713

Cracked? – Dennis – 2015-08-15T00:33:08.300

7

Cracked

MATLAB / OCTAVE, 7 bytes

Code:

cos(pi)

Original output:

ans =

     -1

Changed output:

ans =

   1.5708 - 0.8814i

This gives a Levenshtein distance of exactly 15.

Stewie Griffin

Posted 2015-08-11T08:11:19.767

Reputation: 43 471

Cracked. – David Zhang – 2015-08-12T11:45:03.547

3The big tipoff for me was noticing that the real part of your changed output is pi/2. From there, it wasn't hard to guess the solution. – David Zhang – 2015-08-12T12:51:21.867

6

GolfScript, 15 bytes (safe)

Code

10,{1+3?}%{*}*]

Changed code

107,{1+3?}%{^}*]

Original Output

47784725839872000000

Changed output

557154

Explainations:

10,             # numbers from 0 to 10
   {1+3?}%      # add one and raise to the cube. (%=for each)
          {*}*] # take the product and place it in a list(useless)`

Changed code

107,             # numbers from 0 to 107
    {1+3?}%      # add one and raise to the cube. (%=for each)
           {^}*] # xor them and place it in a list(useless)

Baconaro

Posted 2015-08-11T08:11:19.767

Reputation: 279

I do believe this is safe now, so if you'd like to edit your post – Beta Decay – 2015-08-15T10:00:16.737

@BetaDecay I am! – Baconaro – 2015-08-15T12:20:40.247

6

Cracked

Python 2, 58 bytes

Code

R=range(01234);print sum(m<<min(m,n)for m in R for n in R)

Original Output

2444542772018013876036977350299418162656593659528311114655474359757543862791958572561591492595632222632192542272836836649846934427359810217936317967768095940470375690509652583392001888886352103127515963142

Changed output

4669

That 15 distance rule sure made things tricky. I hope this goes well.

Sp3000

Posted 2015-08-11T08:11:19.767

Reputation: 58 729

The fact that 4669 = 667*7 and that the last element of range(01234) is 667 is suspicious to me... – Fatalize – 2015-08-12T09:12:21.190

If you print out [m<<min(m,n)for m in R for n in R] in the interpreter, you get some really spooky white-noise esque patterns. – Alex Van Liew – 2015-08-12T17:12:05.210

3Cracked. – jimmy23013 – 2015-08-12T18:52:36.593

6

Cracked

Python 2, 50 bytes

Original Code:

'~'*sum([(x,y)[x%2]for x in[y for y in range(8)]])

Original Output:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

Modified Output:

'~~~~~~~~~~~~~~~~~~~'

Not overly short, and maybe not too hard, I don't really know. I'll try to come up with something better soon.

rp.beltran

Posted 2015-08-11T08:11:19.767

Reputation: 281

Is that 40 tildes and then 19 tildes? And I suppose this is run in the interpreter? – Alex Van Liew – 2015-08-13T16:23:29.980

Cracked, I think – Alex Van Liew – 2015-08-13T16:28:31.040

Not cracked yet. Here's what I've done so far, but I know I'm not doing it quite right (since more then 2 chars are changed sometimes. I also don't do inserts/deletes yet). Anyone want to modify it?

– mbomb007 – 2015-08-13T16:43:24.790

2A summary of what I found so far: no combination of replacing x with y, y with x, or changing the digit in the range result in 19 tildes. I also experimented with inserting a - before either x or y, and with changing % to one of + - / *, to no avail. I'm fairly certain now that 1 or 2 inserts is required. – mbomb007 – 2015-08-13T16:47:55.083

I got it. It's a good one. – Alex Van Liew – 2015-08-13T16:53:00.480

1Okay, my first link now cracks it correctly. – Alex Van Liew – 2015-08-13T16:54:10.847

Well done, the solution was indeed to change it to a set comprehension. – rp.beltran – 2015-08-13T16:55:36.240

2I added a small explanation, I actually think this one was really clever. I don't know that I've ever even seen a set comprehension, and also relying on Python leaking y into the enclosing scope was a nice touch. – Alex Van Liew – 2015-08-13T17:00:49.227

Nice! I doubt I would have found that. I've never used a set comprehension before. The scope leaking was interesting as well. – mbomb007 – 2015-08-13T18:13:44.650

6

Cracked

PHP, 164 bytes

Code

$S_U_M_M_E_R = 1;
$A_U_T_U_M_N = 2;
$T_I_M_E = 1;

if ($T_I_M_E == $S_U_M_M_E_R) {
    $A_C_=$T_I_=$O_N= 'SWIM' ? 'TAN' : 'DRINK';
}

print $T_I_M_E * $A_U_T_U_M_N;

Original Output

2

Changed output

-1.1306063769532

Razvan

Posted 2015-08-11T08:11:19.767

Reputation: 1 361

Cracked – Dennis – 2015-08-14T14:48:18.113

Well done! I didn't think it would be that easy to be cracked. – Razvan – 2015-08-14T15:19:27.120

5

Cracked

APL, 7 bytes

Code

-/3⍴157

Original output

157

Changed output

0.11479360684269167J0.37526348448410907

Lynn

Posted 2015-08-11T08:11:19.767

Reputation: 55 648

Is that J in the output evidence that it's a complex number? – mbomb007 – 2015-08-14T21:12:10.873

@mbomb007 Yes, aJb refers to the complex number a + bi. – Dennis – 2015-08-14T23:31:12.887

Cracked – Dennis – 2015-08-15T21:05:51.780

4

Cracked

C, 53 bytes

Code

main(a,_){puts(_*_*_*_*_-1?"Expected Output":"?");}

Original Output

Expected Output

Changed output

?

Probably too easy, but who knows. (Note: it is technically system dependent but the type of system on which it fails would also fail all the other submissions here, so I figured it was a moot point).

Cracked

Edit

I made a mistake. New code which is more secure to the obvious attack:

main(a,_){puts(_*_-1||_*_*_-1||_*_*_*_-1?"Expected Output":"?");}

same outputs. New size of 65 bytes. Hopefully harder... though still probably too easy.

LambdaBeta

Posted 2015-08-11T08:11:19.767

Reputation: 2 499

Cracked – Jakube – 2015-08-11T13:22:23.893

Cracked – TheNumberOne – 2015-08-11T15:40:58.400

2(side note - this should probably have been two answers) – Sp3000 – 2015-08-11T15:41:56.537

@Sp3000 You may be right, although the goal of the original was to have the same solution, I just focussed too much on the problem of odd * count (where you can turn the middle one into a /) and didn't consider the easier *0 change. – LambdaBeta – 2015-08-11T15:51:54.920

4

CJam, 28 bytes (safe)

"jK=\~"5*)ib257b~{G$5$+}*]Jb

Try it online.

Original output

7705397905065379035618588652533563996660018265606606763127193120855297133322151462150247488267491212817218321670720380456985476811737021068519164822984561148339610474891720342171053455881107227302663880445203851079295537592154028123394687360216561235621729967011148112746984677807932995700334185726563970223018774

Modified output

16650180159137697345989048346412185774444335111603430666402604460993564226370500963166158223117360250140073061887053326627468495236957122711656527124216908303912850181595147494475577084810653496778801228980874902968634143062

Solution

"jK=\~"5*Wcib257b~{G$5$+}*]Jb

Try it online.

How it works

I went a little overboard with this one...

The original code does the following:

"jK=\~"5* e# Push "jK=\~jK=\~jK=\~jK=\~jK=\~".
)i        e# Pop the last character and cast it to integer.
b257b     e# Convert the remainder of the string from that base to base 257.
~         e# Dump all resulting base-257 digits on the stack:
          e# 137 72 124 88 81 145 85 32 28 251 118 230 53 13 245 147 256 116 187 22 224
{         e# Do the following 224 times:
  G$5$+   e#   Add copies of the 5th and 17th topmost integers on the stack
          e#   (recurrence of a lagged Fibonacci sequence).
}*        e#
]         e# Wrap the entire stack in an array.
Jb        e# Convert from base 19 to integer.
          e# The resulting integer is printed implicitly.

The intended change is replacing (i with Wci.

This leaves the repeated string untouched and pushes 65535 (by casting to an unsigned 16-bit character, then back to integer), so that the first elements of the lagged Fibonacci sequence become

87 225 162 210 73 196 142 219 175 61 40 147 0 93 75 55 103 116 237 188 108 122 176 133 135 240 251 155 224 82 181 75 23 87 139 49 148 169 84 109 110 166 52 103 83 185 78 73

and the loop is repeated 126 times.

Dennis

Posted 2015-08-11T08:11:19.767

Reputation: 196 637

This is safe now, isn't it? – Beta Decay – 2015-08-15T09:59:03.653

@BetaDecay I pretty much used the same trick in both CJam answers, so I had to wait to post both solutions at once. It is safe now. – Dennis – 2015-08-15T19:25:28.297

Once I worked out what this was, I realised there was so many things that could be tweaked that I didn't even bother trying to brute force this one... nice work :) – Sp3000 – 2015-08-16T05:49:50.463

4

Javascript, 47 (safe)

Code

for(var i=64460,x=773;i>=1324;)x=i--/x;alert(x)

Original Output

11.948938595656971

Changed output

3.679331284911481

Distance is exactly 15.

Tested in Chrome and IE.

Solution

for(var i=64460,x=773;i>>=1<324;)x=i--/x;alert(x)

This uses the bit shift assignment operator i>>=1 to make the loop interval non-linear. Also this has the amusing property that someone trying to brute force a solution will run into several variations that run infinitely.

SLuck49

Posted 2015-08-11T08:11:19.767

Reputation: 901

4

Cracked by issacg

MATLAB, 20 bytes

Code

format long
sin(i^pi)

Original Output

0.331393418243797 - 1.109981778186163i

Changed Output

0.220584040749698 - 0.975367972083631i

Jonas

Posted 2015-08-11T08:11:19.767

Reputation: 381

I tried a bunch of ideas in the Octave interpreter online. Still nothing. I tried things like using sinh, asin, tan, pi^i, etc... – mbomb007 – 2015-08-13T19:48:00.483

@mbomb007 - I'm at a loss here too... and I'm 5th highest on StackOverflow in MATLAB overall! – rayryeng - Reinstate Monica – 2015-08-13T20:12:13.220

Cracked – isaacg – 2015-08-13T20:15:13.333

4

Cracked

Octave, 20 bytes

format long;
cos(1)*1

Output:

0.540302305868140

Changed Output:

111

Daniel

Posted 2015-08-11T08:11:19.767

Reputation: 141

1Cracked – Dennis – 2015-08-15T15:15:35.583

Note: This is only: Octave, not "Octave / MATLAB", which is often the case. – Stewie Griffin – 2015-08-15T15:43:38.200

3

Brainfuck, 100 bytes

Code

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

Original output

ABCDEFGHIJKLMNOPQRSTUVWXYZ

Changed output

[
  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

Note: Possibly easy to crack. But then, nothing is easy in Brainfuck.

Kurousagi

Posted 2015-08-11T08:11:19.767

Reputation: 79

2Are there any unprintable characters in the output? – Sp3000 – 2015-08-11T12:43:09.193

Seems like a few got eaten but there's still a lot of unprintables left when I try and copy and paste, so I'm assuming this is it

– Sp3000 – 2015-08-11T12:49:15.967

@Sp3000 Er- no, there shouldn't be any unprintables. Which interpreter are you using? – Kurousagi – 2015-08-11T12:56:45.030

The method isn't equal to mine, either- keep trying. – Kurousagi – 2015-08-11T12:57:40.900

When I try to copy and paste the changed output string into Python I get '[\n\x0b\x0c \x0e\x0f\x10\x13!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ', indicating some unprintables at the start of the string... – Sp3000 – 2015-08-11T13:02:19.163

When I try to put it in Python it hides the \n\x0b...\x13 part and just gives me errors about the spacing. Let me try with alternative interpreters/charsets. – Kurousagi – 2015-08-11T13:25:01.910

By copying and pasting I mean as an actual string, so surrounding the whole thing with triple quotes. A newline is definitely there, so you should definitely have \n at least... – Sp3000 – 2015-08-11T13:38:15.393

I've just opened it with LiClipse and there is a newline, but it's way off where your result has it. – Kurousagi – 2015-08-11T13:44:46.117

Are you trying your changed output above or the actual output from the interpreter? Remember that SE mangles unprintables – Sp3000 – 2015-08-11T13:49:40.360

The actual interpreter. Still not working. I'll have to try it on a different laptop. – Kurousagi – 2015-08-11T13:51:33.910

As an even more exciting development, if I paste the output string into bash the terminal stops as if I've typed ^S and doesn't start until I type ^Q. – Alex Van Liew – 2015-08-11T17:07:36.263

5If you can post the actual ASCII codes of the output that would be awesome. – Alex Van Liew – 2015-08-11T17:19:34.050

I'd like to ping you again to reply to the comments above. At the moment we're in limbo with this being cracked or uncracked – Beta Decay – 2015-08-14T08:03:08.370

3

Cracked

Java, 149 Characters

class T{public static void main(String[]a){System.out.print(((Integer.MAX_VALUE^25214903917L)&281474976710655L)*25214903917L+11L&281474976710655L);}}

Original Output

174542852132661

Modified Output

106906909674100

Hint:

Random.java

TheNumberOne

Posted 2015-08-11T08:11:19.767

Reputation: 10 855

Cracked. – Alex Van Liew – 2015-08-11T17:34:26.597

3

Cracked

Fantom, 26

Code

Float.makeBits(1123581321)

Original Output

5.55122931E-315

Changed output

124.24518585205078

Security Through Obscurity, if nobody knows the language, nobody can crack it. Levenshtein Distance of 15. Run it in fansh.

Cain

Posted 2015-08-11T08:11:19.767

Reputation: 1 149

I guess I need to learn Fantom... – AboveFire – 2015-08-11T18:56:33.370

2Cracked. – Alex Van Liew – 2015-08-11T19:11:14.740

3

Cracked

VBA, 72 bytes

Sub q()
Dim a(2) As Double
a(0)=-5
a(1)=10
msgbox IRR(a,0.253)
End Sub

Original Output

 0.999999999999136

Adjusted Output

1.82842712474619

Need to see some more VBA representation round here.=) Runs in Excel 2007+

JimmyJazzx

Posted 2015-08-11T08:11:19.767

Reputation: 691

The adjusted output looks so familiar. I feel like that's a number I ought to know. – Alex Van Liew – 2015-08-12T18:16:38.430

@AlexVanLiew The adjusted output is probably equal to 2*sqrt(2)-1 according to WolframAlpha

– mbomb007 – 2015-08-12T20:19:37.377

@mbomb007 Yeah, that's what I was thinking too. I also feel like that number holds some significance, but I don't think it's a trig special angle and I can't think of what might generate it. – Alex Van Liew – 2015-08-12T20:27:51.210

The original output ≈ 1157407407406 / 1157407407407, but I don't think this is significant. I think it's more important to understand how IRR() works, which I don't. – mbomb007 – 2015-08-13T15:23:18.977

1cracked – mbomb007 – 2015-08-13T15:47:03.610

2Good job. Its hard to hide what your doing in vba. So i went with the fact there are a lot of obscure libraries for finance functions that i thought most programmers won't know what they do. Sadly programmers are fast learners. Might have to try again a little more obscure this time. – JimmyJazzx – 2015-08-13T17:36:11.493

3

Cracked

SWI-Prolog, 54 bytes

Code

assert(d(E,F):-(print(E),print(F))). d(123456,123456).

Original Output

true.

123456123456
true.

Changed output

true.

false.

Fatalize

Posted 2015-08-11T08:11:19.767

Reputation: 32 976

I tried to get a SWI-Prolog interpreter working the other day but couldn't, so I'll take a stab in the dark; if you remove the E and F in the print statements do you get what you want? – Alex Van Liew – 2015-08-12T17:36:58.573

@AlexVanLiew I'm getting syntax errors from that – Sp3000 – 2015-08-12T17:52:22.360

@AlexVanLiew Incorrect – Fatalize – 2015-08-12T18:05:50.400

Ah well. Worth a shot. – Alex Van Liew – 2015-08-12T18:13:33.343

Cracked – mgibsonbr – 2015-08-13T03:59:07.873

3

Cracked

CJam, 6 characters

25mse7

Original output

-1323517.5009777304

Changed output

72004899337.38588

This might be too easy. :P

The_Basset_Hound

Posted 2015-08-11T08:11:19.767

Reputation: 1 566

Cracked? The output is slightly different in my browser (and entirely different with the Java interpreter). – Dennis – 2015-08-11T22:21:54.743

@Dennis Not entirely sure why, but the changes are correct. – The_Basset_Hound – 2015-08-11T22:23:49.513

3

Cracked

Ruby, 24

Code

p _=?9;p$.+=1until 9#$./

Original Output

"9"

Changed output

"9"
1
2
3
4
5
6
7
8
9

histocrat

Posted 2015-08-11T08:11:19.767

Reputation: 20 600

1Do all Ruby programs look like someone took a shotgun loaded with ASCII and shot it at the screen, or just the ones that I see here? – Alex Van Liew – 2015-08-13T02:51:35.127

1Ruby was designed to let you choose whether you imitated Perl (seemingly any random keysmash is valid syntax) or Python (just copy-paste the pseudocode and you're good to go). On these sorts of challenges Perlisms tend to do better. – histocrat – 2015-08-13T15:03:43.627

No kidding. I couldn't even figure out what the original snippet does (random space between p and _? adding 1 to the value of the global that keeps track of line numbers 9 times? or adding 1 to the value of p$., which ought to be nil, which seems like it ought to throw an error?). I'll leave this one for one of the greats. Or at least someone that knows Ruby, ahaha. – Alex Van Liew – 2015-08-13T17:12:41.997

The "9" and trailing / makes me think there is a regex involved here – gnibbler – 2015-08-14T22:27:32.733

This one is totally messing with me... Closest so far is p _=?9;p$.+=1until 9<$.... Arrgghh! :) – Dom Hastings – 2015-08-15T12:26:16.453

Cracked! – Dom Hastings – 2015-08-15T15:11:16.730

Argh, well done, almost made it to 3 days. – histocrat – 2015-08-15T16:53:15.120

Sorry, pipped at the post! I will admit that I spent a long time obsessing over comparisons before your mention of Perlisms and @gnibbler's comment about regex got me there in the end! Enjoyed that though, thank you! – Dom Hastings – 2015-08-15T17:28:06.560

3

cracked

modern Perl 5, 70

Code

@array = (qw smiles) x 11;
s/.*// foreach @array;
print "@array\n";

Original Output

A single newline.

Changed output

 mile mile mile mile mile mile mile mile mile mile

The output begins with a space and ends with a newline.

msh210

Posted 2015-08-11T08:11:19.767

Reputation: 3 094

@AlexVanLiew Note that there's a space before the first m! – Dennis – 2015-08-12T21:37:22.763

@Dennis Oh no! I knew it couldn't be that simple. – Alex Van Liew – 2015-08-12T21:38:45.813

I'm not sure, but I think I have it...

– Dom Hastings – 2015-08-13T02:01:37.743

@DomHastings Yep! Well solved. As someone commented on your solution, the additional character can be an extra space anywhere. I said "modern" Perl 5 because each applies to an array only since some version. – msh210 – 2015-08-13T04:22:26.283

2If he hadn't cracked it, would you have said "missed it by a mile"? :D – mbomb007 – 2015-08-13T16:53:19.003

@mbomb007 I kept thinking of that joke when I was trying to find a way to get that 11th mile out of the output. – Alex Van Liew – 2015-08-13T17:13:40.693

@mbomb007 I suffered that too, needed to change a third character to solve it that way. – Adam Katz – 2015-08-15T02:13:32.673

3

Cracked

bc, 22 bytes

4518574615489737231532

Current output

4518574615489737231532

Desired output

195543687803724

abligh

Posted 2015-08-11T08:11:19.767

Reputation: 777

cracked – mbomb007 – 2015-08-13T18:57:28.353

3

Cracked

Matlab, 12 bytes

Code

-sin(2:.5:3)

Original output

-0.9093   -0.5985   -0.1411

Changed output

0.4228    0.7032    0.9228

Luis Mendo

Posted 2015-08-11T08:11:19.767

Reputation: 87 464

Cracked! – Stewie Griffin – 2015-08-13T11:35:59.400

@StewieGriffin Hey, well done! – Luis Mendo – 2015-08-13T14:06:28.577

3

Cracked

Lua, 55 bytes

Now with less skimpy underwear! This code might look like my last code that was sadly cracked, but I can assure the solution is completely different

G={load="lfkjgGsHjkU83fy6dtrg"}
print(tostring(G.load))

Current output:

lfkjgGsHjkU83fy6dtrg

The correct output on 64 bit machines:

26

And on 32 bit machines:

18

Nico A

Posted 2015-08-11T08:11:19.767

Reputation: 2 390

I can't quite figure this one out. – Alex Van Liew – 2015-08-13T02:09:05.080

Sorry, the output is that number. I'll edit my answer. – Nico A – 2015-08-13T17:17:46.367

Cracked by Xrott? – Dennis – 2015-08-14T03:33:24.003

@Dennis Yeah, I'm pretty sure that's the intended solution – Alex Van Liew – 2015-08-14T16:52:14.940

3

perl, 12 bytes

cracked

Code

print sin 97

Original output

0.379607739027522

Desired output

-0.64618863474386

abligh

Posted 2015-08-11T08:11:19.767

Reputation: 777

1I can confirm it's almost certainly not print sin xx, print sin xx97, or print sin 97xx where xx is any two numbers. – Alex Van Liew – 2015-08-13T03:26:44.837

Cracked! – Dom Hastings – 2015-08-13T09:37:43.810

@DomHastings indeed - well done. Out of interest how did you do that? – abligh – 2015-08-13T11:36:11.780

3After reading @AlexVanLiew's comment, I tested similar numbers 9.?7, 9.7?, etc, but realised it had to be an operator. Tried all I could think of in snippets like perl -e 'print map{sin((+"9${_}")x7).$/}1..9' eventually got the right combination! – Dom Hastings – 2015-08-13T12:07:19.230

@DomHastings belated +1 for your crack then. – abligh – 2015-08-13T14:13:49.067

3

Cracked by Luis Mendo

MATLAB, 62 bytes

Code

mistake=-1;tragic=rosser;a=hilb(8)*42;
a(:,:)+tragic(8)/mistake

Original Output

   13.0000   -8.0000  -15.0000  -18.5000  -20.6000  -22.0000  -23.0000  -23.7500
   -8.0000  -15.0000  -18.5000  -20.6000  -22.0000  -23.0000  -23.7500  -24.3333
  -15.0000  -18.5000  -20.6000  -22.0000  -23.0000  -23.7500  -24.3333  -24.8000
  -18.5000  -20.6000  -22.0000  -23.0000  -23.7500  -24.3333  -24.8000  -25.1818
  -20.6000  -22.0000  -23.0000  -23.7500  -24.3333  -24.8000  -25.1818  -25.5000
  -22.0000  -23.0000  -23.7500  -24.3333  -24.8000  -25.1818  -25.5000  -25.7692
  -23.0000  -23.7500  -24.3333  -24.8000  -25.1818  -25.5000  -25.7692  -26.0000
  -23.7500  -24.3333  -24.8000  -25.1818  -25.5000  -25.7692  -26.0000  -26.2000

Changed Output

  -22.0000   19.0000   11.0000  -50.5000  -51.6000    1.0000   -1.0000  -51.7500
   12.0000  -41.0000  -43.5000   -3.6000   -6.0000  -45.0000  -44.7500  -11.3333
   -3.0000  -36.5000  -37.6000  -13.0000  -15.0000  -37.7500  -37.3333  -19.8000
  -29.5000  -17.6000  -20.0000  -31.0000  -30.7500  -25.3333  -26.8000  -29.1818
  -23.6000  -27.0000  -29.0000  -23.7500  -23.3333  -33.8000  -35.1818  -21.5000
  -34.0000  -17.0000  -16.7500  -39.3333  -40.8000  -15.1818  -14.5000  -44.7692
  -43.0000   -9.7500   -9.3333  -47.8000  -49.1818   -7.5000   -6.7692  -53.0000
   -2.7500  -53.3333  -54.8000   -1.1818   -0.5000  -58.7692  -60.0000    1.8000

Jonas

Posted 2015-08-11T08:11:19.767

Reputation: 381

That's just evil. lol. – rayryeng - Reinstate Monica – 2015-08-13T14:56:30.593

@rayryeng: but it has 42 in it! – Jonas – 2015-08-13T14:58:34.417

2... and that's why it's even more evil lol. We still don't know what the question is! – rayryeng - Reinstate Monica – 2015-08-13T14:59:09.767

Cracked – Luis Mendo – 2015-08-13T16:04:52.030

3

Cracked by Luiz Mendo

MATLAB, 40 bytes

Code

format long
arg = [.1 .2 .3];
sin(arg'*exp(9))

Original Output

  -0.220680258232564
  -0.430479305680324
  -0.619052457794081

Changed Output

  -0.803636351328917
  -0.721159584869623
  -0.148487879352133

Hint: there's another solution to this question

Jonas

Posted 2015-08-11T08:11:19.767

Reputation: 381

But this doesn't fulfill the minimum Levenshtein distance requirement – Luis Mendo – 2015-08-13T14:24:37.680

The Lev. distance for this code is 12. Minimum is 15. – rayryeng - Reinstate Monica – 2015-08-13T14:29:44.693

@rayryeng: apologies, format long added :) – Jonas – 2015-08-13T14:43:59.267

Cracked – Luis Mendo – 2015-08-13T15:10:43.753

@LuisMendo: good job! – Jonas – 2015-08-13T16:02:05.960

3

Cracked

Javascript, 53 bytes

Code

a=(((b=(a=1)+a)+a)-b-a)*(a=[b])['length'];
alert(a);

Original Output

0

Changed output

5.551115123125783e-18

Tested under: Firefox, Chrome, IE

Razvan

Posted 2015-08-11T08:11:19.767

Reputation: 1 361

Interesting. So far, I managed to find 5.551115123125783e-17. – Dennis – 2015-08-13T13:54:48.977

I confirm that it should be e-18. I noticed myself the solution for e-17 – Razvan – 2015-08-13T13:57:37.767

Cracked. – jimmy23013 – 2015-08-14T00:02:31.843

3

Cracked.

Stuck, 21 Bytes

I'll start with an easy one, since nobody has seen this before and there's no documents.. Anyways, Stuck is a stack-based language, very similar in usage to CJam. All you need to know is:

NR -> creates a range [1,N] on the stack. 
[N]z -> zips together the top 2 lists, unless an optional N is specified, then the top N lists.
] -> Flattens the top list by one "dimension".

For the record, while I have made commits since this challenge happened, all of this functionality has been present long before.

Code:

1R2R3R4R5R6R7R8R9R9z]

Original Output:

(1, 1, 1, 1, 1, 1, 1, 1, 1)

Changed Output:

(1, 1, 1, 1, 1, 1, 1, 1)(2, 2, 2, 2, 2, 2, 2, 2)(3, 3, 3, 3, 3, 3, 3, 3)

Kade

Posted 2015-08-11T08:11:19.767

Reputation: 7 463

I made a minor edit that I think helps clarify the commands, let me know if it looks good. – Alex Van Liew – 2015-08-13T17:08:52.073

@AlexVanLiew Yeah, that should help clarify :) Thanks! – Kade – 2015-08-13T17:25:00.597

No problem. One other thing: does the R command create an inclusive range or an exclusive range? ie, does 1R push an empty list, or does it push [1]? (same thing for 2R, does it push [1] or [1, 2]?) – Alex Van Liew – 2015-08-13T18:08:41.317

@AlexVanLiew Just clarified that in the post. It's inclusive. – Kade – 2015-08-13T18:21:04.470

Looks good now! – Alex Van Liew – 2015-08-13T18:34:04.767

1Cracked. – Alex Van Liew – 2015-08-14T17:22:17.717

3

Fantom, 30 (safe)

Code

[7115432d/9,219.or(64),37][0]

Original Output

790603.5555555556

Changed output

55

Solution

"7115432d/9,219.or(64),37"[0]

By changing the array to a string literal, the index call actually gets the first character of the string. Characters in fantom are actually just ints, so the value of '7' is 55.

Cain

Posted 2015-08-11T08:11:19.767

Reputation: 1 149

1Hey, you can still change the . to a , and change the index to 3 ([7115432d/9,219.or(64),37,55,0f][3]). I'll give you grace so you can fix it up again. ;P – Alex Van Liew – 2015-08-13T17:06:33.493

1Hey, thanks, that distraction was too much work for what it was worth – Cain – 2015-08-13T18:08:24.257

You enjoy red herrings, don't you? 119.xor(64) is so close! – Alex Van Liew – 2015-08-13T18:22:07.327

@AlexVanLiew Haha that's the idea, I wanted 55 to come up all over the place – Cain – 2015-08-13T18:37:01.390

3

PowerShell v3, 384 (SAFE)

(My second post ever on PPCG, please be gentle. :) I think I'm going to like this community!)

Code:

$s="a*h*t*s*m*i*d*o*n*l*k*e*y*u*g*r*w*LOOD> AIG BAE>!+<R S!>>+<GH MHN JFKL> LOOD AIG BAE>?<+"
$cur="";$l="";[char]$n="A";$st=@{}
foreach($c in [char[]]$s){switch -regex($c){
"[\*\>]" {$st[$n]=$cur.TrimStart(" ");$n=[char]([int]$n-1);if($c-eq">"){$l+=$cur};$cur=""}
"\+" {$l=$cur;$cur=""}
"\<" {$l+$cur;$l="";$cur=""}
default {if($st.Contains($c)){$cur+=$st[$c]}else{$cur+=$c}}}}

Original output:

eggs and ham!
eggs and ham!
do you like eggs and ham?

Modified output:

!

GH MHN JFKL LOOD aIG BaEt

(to be clear, that's a blank line in the middle of the modified output)

Mini-hint:

h/t to Adam Barr for the inspiration

Edit - Safe - Below is corrected code, and below that is explanation

$s = "a*h*t*s*m*i*d*o*n*l*k*e*y*u*g*r*w*LOOD> AIG BAE>!+<R S!>>+<GH MHN JFKL> LOOD AIG BAE>?<+" # The string we're cycling through
$cur = "" # What word(s) we've currently built
$l = "" # The current line we've finished building
[char]$n = "A" # Cast as a character instead of a string, this is the index of our temporary store
$st = @{} # Our temporary store - the first time through, this will populate out with the first part of the string $s
foreach ($c in [char[]]$s) { # Loop through the string $s as an array, one $c character at a time
    switch -regex ($c) {
        "[\*\>]" {
            $st[$n] = $cur.TrimStart(" ") # Ensures that we're not adding a space, and adds what we've currently built into the store
            $n = [char]([int]$n + 1)    #ONE OF THE CHANGES - Changed the +1 to -1, which causes the indexing of the store to be off
            if ($c -eq ">") { $l += $cur } # If our current character is a >, add that to the line as it's finished
            $cur = "" # Reset what we're building
        }
        "\+" {
            $l += $cur #ONE OF THE CHANGES - Changed the += to =, which causes the line to not get printed
            $cur = "" # Reset what we're building
        }
        "\<" {
            $l + $cur # Add on our current word to the line and print it out
            $l = "" # Reset our line
            $cur = "" # Reset what we're building
        }
        default {
            if ($st.Contains($c)) {
                $cur += $st[$c] # If our store contains the character, add what's in the store's index at $c to our current word
            } else {
                $cur += $c # Else, just add the character to our current word
            }
        }
    }
}

Explanation

The best way to explain this is that we're using the string at the start as a sort of cypher. The first half of the string, demarcated by asterisks, is our cypher results. The rest of the string is the output, encoded based off of the "integer" value of the letter (from an alphabetical perspective, not an ASCII perspective). For example, the LOOD> takes the 12th character (an e), the 15th character (a g) twice, and then the 4th character (a s), which forms the word eggs, then the > case, which trims off what we're building so that our words don't run together.

The script cycles through the string character by character, building the cypher store at first (because of all the asterisks, the first 34 times through the switch causes either the first case or the default case to be called), while the rest of the times through cause either an index lookup (because we've already added that letter) or text manipulation (e.g., the second change which just re-sets a variable rather than print it out).

Please let me know if you have further questions!

AdmBorkBork

Posted 2015-08-11T08:11:19.767

Reputation: 41 581

This is safe now, you can reveal the solution if you wish – Beta Decay – 2015-08-16T00:13:23.957

3

Befunge 98, 30 Bytes(Safe)

Code

153+:*,+:f`#v_
+ ':_;#:-1;#@;,

Original output:

@@@@@@@@@@@@@@@@

Changed output:

@~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!

Solution

g53+:*,+:f`#v_
+ ':_;#:-1;#<@;,

MegaTom

Posted 2015-08-11T08:11:19.767

Reputation: 3 787

Why u so cruel?! – mbomb007 – 2015-08-13T19:49:36.120

Is there a trailing space in the changed output? – Alex Van Liew – 2015-08-14T17:53:51.897

@AlexVanLiew no trailing space. The '!' is the last character. – MegaTom – 2015-08-14T18:46:36.387

Alright, I might give this a try when I get home. I've always wanted an excuse to learn this language. Can you link to the interpreter/compiler you used? – Alex Van Liew – 2015-08-14T18:47:20.200

@AlexVanLiew http://befungius.aurlien.net

– MegaTom – 2015-08-14T18:48:11.897

@MegaTom I can tell you worked hard on this. I can sort of see what I need to do but I don't know how to do it with just two changes, especially since the second line doesn't contain any flow control. – Alex Van Liew – 2015-08-14T20:16:15.577

This is safe now, you can reveal the solution of you wish – Beta Decay – 2015-08-16T00:13:00.993

@MegaTom Nice! I was getting pretty close; I had a pretty good idea of what the last line looked like and I looked into using g, but I didn't try it right there. – Alex Van Liew – 2015-08-16T16:16:30.643

3

Perl, 49 byes (safe)

Code

$_=cos 99;printf"%.16f",0x7275*sin $_/s/[3-8]/04/

Original Output

145.9795577401910975

Changed Output

23.3077670014990304

Clue

I tried to do this before but there was another unintended (easier) solution. The robber to my previous challenge may help you solve this one. Try to solve it with three modifications and you'll be half way to the two modification answer.

Solution

$_=cos 99;printf"%.16f",07275*sin $_/y/[3-8]/04/

1. Remove the x to turn hexadecimal 0x7275 (decimal 29301) into octal 07275 (decimal 3773)

2. Change the s/// (replacement) to y/// (transliteration) so that instead of the first digit from 3-8 becoming the string 04, all digits in that range become 4. Additionally, both return the number of changes; the s/// version only makes one change while y/// makes all 8 changes (the way s///g would). If you could change a third character, you could do s/[3-8]/4/g and have the same result as my y/[3-8]/04/. (This was exploited to solve my previous attempt.)

Example of s/// vs y///:

$_="s: 1234567890, ";s/[3-8]/04/;print; $_="y: 1234567890";y/[3-8]/04/;print
s: 12044567890, y: 1244444490
So therefore we're multiplying by a changed number and the function at the end alters the default variable differently and divides by a different number.

Adam Katz

Posted 2015-08-11T08:11:19.767

Reputation: 306

1Good going! Closest I got was 23.5402686025187862 with $_=cos 99;printf"%.16f",0x1275*sin $_/s/[3-8]/04/ didn't think to change the s///, d'oh! – Dom Hastings – 2015-08-19T06:35:18.293

3

Malbolge, 411 bytes

Code

bCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9y76543210/(L,l$H('&%$#"!~}v{zyxwvutm3qponmlkjihgfedcba`_^]?zZYXWVOTSRQPONMFjJIHGFEDC<`@?!=<;4X87w/S3s10/.-,+*)('&%$#"!~}|{zyxq7Xtmrk1onPlkdihg`&dcbD`_^]\[ZYXQutTSRQPONMLKJCgGFEDCBA@?>=<;:z81Uv43210/.'Kl*#G'&f|{A!~}|{zs9qvo5mrqponmle+*hgfe^c\"`_^]\[ZYXWV8Nr5QPONGkKJ,HGFEDCBA@?>=<;:3W76/432+O/o-,+*)('&%|B/

Original output

Two Makes All The Difference

Modified output

Two 

(note the trailing space)

Solution

bCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9y76543210/(L,l$H('&%$#"!~}v{zyxwvutm3qponmlkjihgfedcba`_^]?zZYXWcOTSRQPONMFjJIHGFEDC<`@?!=<;4X87w/S3s10/.-,+*)('&%$#"!~}|{zyxq7Xtmrk1onPlkdihg`&dcbD`_^]\[ZYXQutTSRQPONMLKJCgGFEDCBA@?>=<;:z81Uv43210/.'Kl*#G'&f|{A!~}|{zs9qvo5mrqponmle+*hgfe^c\"`_^]\[ZYXWV8sr5QPONGkKJ,HGFEDCBA@?>=<;:3W76/432+O/o-,+*)('&%|B/

Dennis

Posted 2015-08-11T08:11:19.767

Reputation: 196 637

2

Cracked

C++ 91 Bytes

#include <iostream>
int main()
{
    //can you figure it out?
    std::cout << "I like cake and";
}

Output:

I like cake and

Changed output

DoYouEvenCodeBro

Posted 2015-08-11T08:11:19.767

Reputation: 131

Your changed output is unclear? Is empty, a single newline or something else? – Dennis – 2015-08-11T21:55:24.773

Cracked. I'm not really sure this is valid, though, as the spec says that output must be non-empty; it's unclear if this refers to both outputs or just the original one. – Alex Van Liew – 2015-08-11T22:03:11.287

This is invalid. None of the outputs can be empty. CC @AlexVanLiew – Beta Decay – 2015-08-11T22:22:17.087

Alex, I can't comment on the other post (not enough rep) but you got me – DoYouEvenCodeBro – 2015-08-11T23:03:11.450

@f41lurizer Good try for a first post, but trigraphs and other similar shenanigans are pretty well known around here. Try giving it another go! – Alex Van Liew – 2015-08-12T18:18:06.600

Trigraphs are forbidden in underhanded, and this is kinda of like an underhanded.

– mbomb007 – 2015-08-13T18:44:25.650

I mean, you could also just add // before std::cout... – Lynn – 2015-08-16T20:17:54.137

2

Cracked

Python 2, 57 bytes

Code

i=long;j=map;print reduce(i.__mul__,j(i,j(ord,`i`)))/1234

Original Output

3164217824783520557889

Changed output

9072146982802639849575831250318562874251

Blue

Posted 2015-08-11T08:11:19.767

Reputation: 26 661

Cracked – Sp3000 – 2015-08-12T09:52:50.697

2

Python 2/3, 70 bytes (safe)

Code

x=932436
for i in range(99**4):x=(1103515245*x+12345)%2**31
print(x*x)

Original Output

211455574532454121

Changed output

1039038861760158249

Solution

x=9372436
for i in range(59**4):x=(1103515245*x+12345)%2**31
print(x*x)

The solution initializes x to 9372436 instead of 932436, and does range(59**4) instead of range(99**4). As an aside, the solution runs in about 1/10th of the time.

I probably could have made it shorter without making it too much easier, or at all easier.

Cyphase

Posted 2015-08-11T08:11:19.767

Reputation: 221

This is python 3 only, but i assume that using python 2 won't hurt (original code returns (459842989, 459842989)) – Blue – 2015-08-12T10:17:11.027

Oh yea, I doubled the output to conform to the Levenshtein distance rule; forgot it would be a tuple in Python 2. Still, same effect. – Cyphase – 2015-08-12T10:38:22.377

Since you use brackets on the print, I think you should say this is Python 3, for good form – Beta Decay – 2015-08-12T12:04:03.057

Those two parentheses are the only difference between Python 2 only and Python 2/3; the output is slightly different in each, but I don't think that violates any rules; certainly not the spirit of the rules. But if it really is bad form, I guess I'd go with the Python 2 only version to save 1 byte. – Cyphase – 2015-08-12T12:08:00.100

wouldn't print(x*x) work ok too? – gnibbler – 2015-08-13T14:10:35.270

facepalm Thanks @gnibbler :). – Cyphase – 2015-08-13T14:17:44.060

@Cyphase The output slightly differs... In that case you have to choose one or the other – Beta Decay – 2015-08-13T21:34:42.167

@BetaDecay, not anymore, thanks to gnibbler's comment. – Cyphase – 2015-08-13T21:36:25.763

2

Cracked

Python 2, 41 bytes

Code

print sum((ord(i)<<0x156 for i in `sum`))

Original Output

19718712710133388269747721838124583424582966957653854505259504044885223633870136963133245450763229047291904

Changed output

20

Blue

Posted 2015-08-11T08:11:19.767

Reputation: 26 661

Cracked – Sp3000 – 2015-08-12T12:15:30.553

2

Cracked

PHP 5.4, 92 bytes

<?php
define('E','!');

$x = 4;
$t = " Hello World";
$t .= E;
$t .= E;
$t .= E;

print($t);

Output:

 Hello World!!!

Changed Output:

 Hello World! Hello World! Hello World! Hello World!

(Note: both outputs include a leading space)

Dom Hastings

Posted 2015-08-11T08:11:19.767

Reputation: 16 415

Please refer to the formatting guide (Byte count is missing) ;) – Beta Decay – 2015-08-12T12:04:59.810

@BetaDecay sorry, I missed that! Usually I omit that from non-golfed code and completely missed it in the rules! – Dom Hastings – 2015-08-12T12:14:19.230

It's fine by me :-D – Beta Decay – 2015-08-12T12:15:41.633

Crack attempt #2 – Nathan Merrill – 2015-08-12T12:36:33.453

@NathanMerrill You got it! – Dom Hastings – 2015-08-12T12:43:48.993

2

Cracked

Lua, 54 Bytes

G={string="gs_hSDrGSFG5;U*ts"}
print(tostring(G.string))

Current output:

gs_hSDrGSFG5;U*ts

Desired output:

23

Note: I'm not exactly sure why, but if you are using an online compiler (specifically repl.it) the correct output will be 15.

Nico A

Posted 2015-08-11T08:11:19.767

Reputation: 2 390

Could you post which environment you're using that achieves 23? I can get 15 in lots of different ways on repl.it and lua53.exe. – Alex Van Liew – 2015-08-12T18:39:26.323

Lua 5.2 on Windows 7. Don't think it makes a difference, but installed through LuaRocks. – Nico A – 2015-08-12T18:48:31.020

This might give it away, but the way you tell is this program: t = {} print(t) If it says table: 0000000(random numbers) then the correct answer is 23, if it says 0x(random stuff) the correct answer is 15. – Nico A – 2015-08-12T18:52:17.693

Hmm. Well, cracked? I'm almost certain the reason the 15/23 difference exists is because the intended solution has to do with pointer size (if you print a table, it prints the memory location); so on a 64-bit system you go from a 8-character pointer to a 16-character pointer; which accounts for the missing (extra?) 8 characters. I'll see if I can figure out what the intended solution was in the meantime, though.

– Alex Van Liew – 2015-08-12T18:52:36.247

Actually no, I'm going to edit my code a bit. The only reason you got 15 is because the length of G.string is 15, but the length of G is only 15 because of the Levenshtien distance rule. Sorry about that, I'm going to edit my code. – Nico A – 2015-08-12T18:53:52.727

Bahaha. Don't forget to edit the output too! ;P @BetaDecay, what do you think about this? – Alex Van Liew – 2015-08-12T18:54:43.667

I mean, you technically didn't get it because you were getting 15 on something you should have been getting 23 on, but then again... This is weird. We will differ to the judgement of the OP. Sorry about this. – Nico A – 2015-08-12T18:56:49.023

I understand how the intended solution is supposed to look, but I don't know enough Lua syntax to figure out how to do it, ahaha. Until OP responds I'll keep looking for the intended solution. – Alex Van Liew – 2015-08-12T19:00:27.510

I fixed it anyway. – Alex Van Liew – 2015-08-12T19:29:39.880

2

Cracked

Javascript, 169 bytes

Code

a=1,b=a*2,c=a+b,d=[a+b];while(c>b)c-=a;for(i=1;i<=c;i++)d.push(i);i=''+c*d['length']*d['length'];alert(Math[String.fromCharCode(i.charCodeAt(0) * i.charCodeAt(1) / 32)])

Original Output

undefined

Changed output

2.718281828459045

Razvan

Posted 2015-08-11T08:11:19.767

Reputation: 1 361

Cracked. – Dennis – 2015-08-12T16:37:46.247

2

Cracked

MATLAB / OCTAVE, 28 bytes

Code:

f=@(x)x^.7;g=@(x)7/f(x);g(7)

Original output:

ans =

    1.7928

Changed output

ans =

  -0.3011 - 0.4144i

Stewie Griffin

Posted 2015-08-11T08:11:19.767

Reputation: 43 471

1Cracked – rayryeng - Reinstate Monica – 2015-08-12T19:20:49.333

2

Cracked

Clojure, 35 Bytes

Code

(printf "%d\n" 2155263413256326162)

Original Output

2155263413256326162
nil

Changed output

3681347803529195
nil

Bob Jarvis - Reinstate Monica

Posted 2015-08-11T08:11:19.767

Reputation: 544

Cracked. – Alex Van Liew – 2015-08-12T18:11:44.700

2

Cracked

MATLAB / Octave, 33 bytes

Code

eig(cov(reshape(sin(1:60),5,[])))

Original Output

ans =

   -0.0000
   -0.0000
   -0.0000
   -0.0000
   -0.0000
   -0.0000
    0.0000
    0.0000
    0.0000
    0.0000
    2.4410
    4.5766

Changed Output

ans =

    0.0064
    0.0000
    0.0000
   -0.0000
   -0.0000
    0.0000

rayryeng - Reinstate Monica

Posted 2015-08-11T08:11:19.767

Reputation: 1 521

Cracked – Luis Mendo – 2015-08-12T22:44:24.187

2

Cracked

PHP, 21 bytes

Code

print_r(range(i,09));

Original Output

Array ( [0] => 0 )

Changed output

Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 )

Ismael Miguel

Posted 2015-08-11T08:11:19.767

Reputation: 6 797

Cracked. – Alex Van Liew – 2015-08-12T21:31:46.487

2

Fantom, 34

Code

[7115432d/9,219.or(64),37,5555][0]

Original Output

790603.5555555556

Changed output

55

Ok, hopefully this one is a little more competitive than my previous attempt. Levenshtein Distance of 15. Run it in fansh.

Better Code

@isaacg found an easy solution I hadn't even seen. This code removes that solution while keeping the original one I intended, if anyone still wants the challenge.

[7115432d/9,219.or(64),37,55.0f][0]

Cain

Posted 2015-08-11T08:11:19.767

Reputation: 1 149

Cracked. – isaacg – 2015-08-13T00:39:48.397

1This is clearly not my game – Cain – 2015-08-13T01:35:11.007

@Sp3000 I mean the new code I posted is the one to be cracked, without the loophole I missed that isaacg found. – Cain – 2015-08-13T01:43:59.463

2I think it'd be better to make a new answer for that (or you won't show up on the snippet) – Sp3000 – 2015-08-13T01:48:29.030

2

Cracked

Matlab/Octave, 10 bytes

this should be a fairly easy one.

I only tried it with Octave online, but it should run fine in matlab.

Code:

e^(i*pi)+1

Output

0.0000e+00 + 1.2246e-16i

Changed Output

1.9336e+04

paul.oderso

Posted 2015-08-11T08:11:19.767

Reputation: 61

Cracked. – isaacg – 2015-08-13T08:21:00.380

@isaacg not the solution i had intended, but it works ;) to keep it short i left out the format long, then using 2 would not match the output.

but nevertheless, well done! – paul.oderso – 2015-08-13T08:51:46.363

1+e then, I assume? – isaacg – 2015-08-13T08:58:22.767

@isaacg right ;) – paul.oderso – 2015-08-13T09:11:49.820

2

Mathematica, 35 bytes (safe)

Code

z=Zeta[4/3,1/2];N[Min[z,Sec[z]],20]

Original Output

1.4508303658284314991

Changed output

-0.72451364607415832407

Edit: Note that the original code will sort-of work on Wolfram Alpha, but the modified code does not.

Changed Code

z=Zeta[4/3,1/2];N[Sin[z,Set[z]],20]

Set[z] evaluates to Sequence[] so Sin[z,Set[z]] = Sin[z]. Moreover, Mathematica evaluates function arguments serially and in order, so Set[z] is evaluated after the value of z is already used.

jcai

Posted 2015-08-11T08:11:19.767

Reputation: 973

5I hate seeing answers in Mathematica, since it's a proprietary language. There's no way for us to test it if we don't pay for it. – mbomb007 – 2015-08-13T19:49:09.550

1@mbomb007 Many people on PPCG do have a copy of Mathematica. If you don't, then you can simply scroll past my answer. – jcai – 2015-08-13T20:00:07.813

Sometimes they work on WolframAlpha. – Alex Van Liew – 2015-08-13T20:37:05.227

@mbomb007 - MATLAB is as well, but I don't see people complaining about it. Octave is not a full replacement to MATLAB, much like Wolfram Alpha isn't a replacement for Mathematica. I like seeing Mathematica code because it's cool to see how some minor changes gives you extraordinarily different output. – rayryeng - Reinstate Monica – 2015-08-14T15:14:35.607

2

Cracked

GolfScript, 4 bytes

9,!9

Original output

09

(trailing linefeed)

Modified output

0123456789012345678

(no trailing linefeeed)


If you test your code in Web GolfScript, you have to look at the source code of the output, since the (lack of a) trailing linefeed will be undetectable in the rendered page. For the correct solution, there should be no linefeed between 0123456789012345678 and </textarea>.

It might be easier to use the Ruby interpreter for this one.

Dennis

Posted 2015-08-11T08:11:19.767

Reputation: 196 637

0123456789012345678? – The_Basset_Hound – 2015-08-13T21:08:06.020

Yes, the 9 has to stay. – Dennis – 2015-08-13T21:09:29.917

[Muahaha][http://codegolf.stackexchange.com/questions/54466/two-makes-all-the-difference-robbers/54672#54672] – The_Basset_Hound – 2015-08-13T21:23:05.077

Crap, how do I format that? – The_Basset_Hound – 2015-08-13T21:23:22.820

@BassetHound text

– Beta Decay – 2015-08-13T21:29:25.503

This is devilish ;) – Beta Decay – 2015-08-13T21:32:15.290

@BetaDecay Alright, thanks – The_Basset_Hound – 2015-08-13T21:34:46.747

How do I run the ruby interpreter? – The_Basset_Hound – 2015-08-13T22:35:07.050

@BassetHound ruby golfscript.rb filename.gs Requires Ruby. :P – Dennis – 2015-08-13T22:37:45.657

3Cracked. – jimmy23013 – 2015-08-13T23:22:10.580

2

MATLAB, 56 bytes (SAFE)

I think this is a step up from some of the previous MATLAB questions, but that remains to be seen I guess:

Code

p=.4 -.2*i;j=.3*i +.7;i=@(c)j./(.6- .4*c);asin(i(p) *5i)

Original output

ans =

  -0.2236 + 2.8380i

Changed output

ans =

   0.1799 + 6.5793i   0.1798 + 5.4395i

Solution:

p=.4 -.2*i;j=.3*'i '+.7;i=@(c)j./(.6- .4*c);asin(i(p) *5i)

Simply change .3*i +.7 to .3*'i '+.7; This creates a vector with the numbers [105 32], since MATLAB automatically casts the chars to integers if it's part of an equation.

All the spaces were just to throw people off (it made it possible to do changes like [.3*i 0.7];, thus making it possible to create vectors this way too.

Stewie Griffin

Posted 2015-08-11T08:11:19.767

Reputation: 43 471

2

Cracked

CSS, 53

Code

body:after{counter-reset:a 512;content:counter(a)"₽"}

Original Output

512₽

Changed output

0%

Snippet

body:after{counter-reset:a 512;content:counter(a)"₽"}

Qwertiy

Posted 2015-08-11T08:11:19.767

Reputation: 2 697

"The changed output must have a Levenshtein Distance of 15 or more from your original output." – Jakube – 2015-08-14T09:19:34.667

@Jakube, ok, I'll think about a fix. Anyway, there is no common symbols in input and output and it's impossible to only change output directly without getting my idea. – Qwertiy – 2015-08-14T09:40:13.280

Cracked and unfortunately i don't think a high enough distance is possible because counter-reset maxes at 2417483647 – SLuck49 – 2015-08-14T12:34:30.307

I was wrong, it is possible if you add multiple counters like so body:after{counter-reset:a 2417483647;content:counter(a)counter(a)"₽"} – SLuck49 – 2015-08-14T12:40:01.187

@SLuck49 Your "cracked" link is wrong. – isaacg – 2015-08-14T19:57:50.833

2

Cracked

APL, 5 characters

3⍟877

Current output

6.1682424839682115

Modified output

0.20016493054644696

An edit distance of 16.

Lynn

Posted 2015-08-11T08:11:19.767

Reputation: 55 648

Cracked – Dennis – 2015-08-16T17:44:40.357

2

APL, 9 bytes

Code

+/○3-3⍴⍳5

Original output

18.84955592153876

Changed output

¯0.31830988618379086 0.31830988618379075 0

Looks like I just missed the deadline, because I suck at time zones. Have fun solving this, anyway.

Lynn

Posted 2015-08-11T08:11:19.767

Reputation: 55 648

1

Cracked

SWI-Prolog, 54 bytes

Code

assert((o(X,Y,Z):-ABC is X**X,print(ABC))). o(99,y,z).

Original Output

true.

369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899
true.

Changed output

true.

true.

mgibsonbr

Posted 2015-08-11T08:11:19.767

Reputation: 121

Cracked – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2015-08-13T09:16:02.943

@n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ I'm not really sure if adding a whitespace counts as a "change", I asked the OP about that. If that's ok, then I'll accept it (the way I originally thought really requires two "effective" modifications).

– mgibsonbr – 2015-08-13T18:22:32.480

Technically, I can also change the number 99. It's also a trivial change anyway. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2015-08-13T22:11:56.583

@n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ In that case, well done! What I originally thought was replacing o(99,y,z) for op(99,fy,z), so the 2nd call would just succeed without calling o (and without creating a choice point, like your solution). – mgibsonbr – 2015-08-14T00:52:40.603

BTW for everyone's reference, I only realized a bit too late how similar my attempt and Fatalize's are (otherwise, I wouldn't even have posted this).

– mgibsonbr – 2015-08-14T00:55:00.750

1

Cracked

Javascript, 233 bytes

Code

one = 1;
two = one + one;
three = two + one;
zero = three - two - one;
numbers = [three, two, one];

for (i = numbers.length - 1; i >= zero; i--) {
    numbers.pop();
}

infinity = 1 / numbers['length'];
alert(infinity);

Original Output

Infinity

Changed output

3.333333333333333

Razvan

Posted 2015-08-11T08:11:19.767

Reputation: 1 361

I tested it on Firefox, Internet Explorer and Chrome. Windows 64bit. I guess your solution could be fine (maybe it's just a rounding in the end). – Razvan – 2015-08-13T13:11:19.217

Cracked, Sorry @Sp3000, posted literal one second after your comment – SLuck49 – 2015-08-13T13:13:25.227

1

Cracked, because I didn't check the simple solution

MATLAB, 8 bytes

Code

sin(1+1)

Original Output

0.909297426825682

Changed Output

-0.262374853703929

Jonas

Posted 2015-08-11T08:11:19.767

Reputation: 381

1Cracked possibly? – Sp3000 – 2015-08-13T12:45:33.030

you need format long enabled to see all the numbers – Jonas – 2015-08-13T12:45:35.463

@Sp3000: yes, of course that works as well :) – Jonas – 2015-08-13T12:48:55.377

1

Cracked

Python, 227 Bytes

Original Code:

import re;''.join(re.findall('\w(?=\w\w)','t74q joh7 jv f9dfij9j bfjtf0e nnjen3j nnjrb6fgam3gtm5tem3hj s3eim7djsd3ye d5dfhg5un7ljmm8nan3nn6n k m2ftm5bsof5bf r5arm4ken8 adcm3nub0 nfrn6sn3jfeb6n d m6jda5 gdif5vh6 gij7fnb2eb0g '))

Original Output:

't7jof9dfijbfjtfnnjennnjrb6fgam3gtm5tem3s3eim7djsd3d5dfhg5un7ljmm8nan3nnm2ftm5bsof5r5arm4keadcm3nunfrn6sn3jfebm6jdgdif5vgij7fnb2eb'

Changed Output:

'to iterate is human to recurse divine'

rp.beltran

Posted 2015-08-11T08:11:19.767

Reputation: 281

Cracked – isaacg – 2015-08-14T08:54:39.050

1

PHP, 299

(I hope I have understood the challenge correctly. It seems hard to produce code where and 2 single-character changes make such a difference, even if ignoring whitespace etc.)

Code

<?php $i=0x61;$x=0x15;$y=0x36;$k="";$me=<<<PHP
\$q=\$i=\$i-1;\$x++;\$x=\$x^\$i^$x;if(\$i>0){
for(\$z=0;\$z<__LINE__;\$z++){for(\$l=strlen
("\$me")-1;\$l>=0;\$l--)\$q=\$q^(int)(\$x^
ord(\$me[\$l]));}\$k.=\$q;\$me="/**/\$me";
\$me.="#";eval(\$me);}
PHP;
eval($me);echo wordwrap($k,30,"\n",true)."\n";

FYI: Proof it takes < 1 minute on any modern hardware:

$ time php /tmp/wot.php
711752729711068167264259526921
...
real    0m4.580s
user    0m1.548s
sys     0m3.023s

Original Output

969594939291908988878685848382
818079787776757473727170696867
666564636261605958575655545352
515049484746454443424140393837
363534333231302928272625242322
212019181716151413121110987654
321

Changed output

127127127127127255255255255255
255255255383383383383383383383
383383383511511511511511511511
511511511511511511511639639767
767767767767767895895895895895
895895895895102310231023102311
511151115111511151115111511151
115111511151127912791279127912
791279127912791407140714071407
140714071407140714071407153515
351535153515351535153515351535

wally

Posted 2015-08-11T08:11:19.767

Reputation: 263

I can see a huge number of possible permutations that could be tried in the hex values alone. This seems non-deterministic, which is to say, any small change you make, causes a huge pseudorandom output, so the only way to find it would be to brute force those numbers, or find a solution elsewhere in the code somehow.

Beyond my abiliity, I think. – Dewi Morgan – 2015-08-15T06:07:53.673

Obviously my "solution" is (and always was) too long to be a winner ... so I'll drop some hints ;-)

The use of eval() is recursive - and changes the output if you add whitespace or debug code in it. You could call the eval'd code directly - and just keep a copy of the eval'd variable string separately for it to use...

I think I'd advise you start there. – wally – 2015-08-17T08:22:44.577

...oh and it intentionally uses loops in loops to make it prohibitively "expensive" to brute force. You might be able to optimize one of them out if you're careful. – wally – 2015-08-17T08:25:40.850

1

OCTAVE, 157 bytes.

format long 
sin(cos(tan(csc(sec(cot(asin(acos(atan(acsc(asec(acot(sinh(cosh(tanh(csch(sech(coth(asinh(acosh(atanh(acsch(asech(acoth(i))))))))))))))))))))))))

Output:8.77828266022653e+276+3.46629794728664e+276i

Modified Output:1.32478170985912-7.32035312239031i

Teoc

Posted 2015-08-11T08:11:19.767

Reputation: 182

2Well that's just not fair ;) – Beta Decay – 2015-08-14T17:52:23.623

@BetaDecay Of course it is. It abides by all the rules, eh? But brute force should be able to find the solution easily. – Teoc – 2015-08-14T17:55:04.480

@VladimirLenin He made a winky-face. He knows it's fair. You must've missed it. – mbomb007 – 2015-08-14T17:56:04.287

I give a simple estimate of a few thousand adjustments worth trying (roughly 3 for each trig function, choose 2). – mbomb007 – 2015-08-14T18:00:32.143

@mbomb007 Then it should only take around $\binom{24}{2}\cdot 3^2=2484$ operations, much less than a second to run. – Teoc – 2015-08-14T18:04:09.540

@mbomb007 Oops, accidentally put a acos instead of a acot in my code. Fixed – Teoc – 2015-08-14T18:08:29.933

Is that one of the character changes? :) Or is it an intentional mind game to make us think it is. :S – mbomb007 – 2015-08-14T19:35:47.513

@mbomb007 It is not, just an accidental copying error – Teoc – 2015-08-14T20:36:35.913

I don't get that (original) output. I get 1.823149956544422e+206 -3.066417174909405e+206i – Luis Mendo – 2015-08-14T22:57:57.527

@LuisMendo Are you using wolfram/Mathematica? Mathematica uses a different range of the acot() function. The answer displays correctly on the online interpreter for OCTAVE. The modified output on the other language should be the same, except that it is a plus instead of a minus in the middle. – Teoc – 2015-08-14T23:43:14.910

I get ans = 8.77828266017083e+276 + 3.46629794726118e+276i using octave, which slightly differs from the output in the question. – Daniel – 2015-08-15T10:46:40.570

@VladimirLenin I'm using Matlab R2014b – Luis Mendo – 2015-08-15T12:15:58.947

I get the wrong output too! It's hard to check if the solution is correct when the original output is different than what we get when running the code...Matlab R2011a and R2014b. – Stewie Griffin – 2015-08-15T14:55:17.573

@Daniel probably some rounding errors or floating point errors – Teoc – 2015-08-15T15:47:58.107

1@LuisMendo it seems to be only compatible with octave, let me change the header – Teoc – 2015-08-15T15:48:26.143

@VladimirLenin, have you checked if the result of the changed code is the same in MATLAB and Octave...? I like MATLAB way better! – Stewie Griffin – 2015-08-15T15:56:01.297

@StewieGriffin If matlab is outputting the same thing as wolfram is (like on the normal), then it should be the same output but with a minus sign in the middle. I'm away from my PC so I can't check. – Teoc – 2015-08-15T16:00:12.433

1

Cracked.

CJam, 9 bytes

Attempt 3...

Ps"."-i2b

Try the code at this correct link.

Expected output

1011001010010100001100001010001001010110110100100001

Modified output

5010670554118

Another easy one??

The_Basset_Hound

Posted 2015-08-11T08:11:19.767

Reputation: 1 566

Cracked – Dennis – 2015-08-14T20:00:29.860

1

Cracked

Perl, 48 bytes

Code

$_=cos 99;printf"%.14f",0x7275*sin $_/s/[3-8]/0/

Original Output

287.75699066847318

Changed Output

144.01504526079819

Adam Katz

Posted 2015-08-11T08:11:19.767

Reputation: 306

Cracked – Dennis – 2015-08-15T04:37:25.927

crap, that wasn't my solution (though it does work) ... I thought I proofed against that. I had to make some last min changes to hit a proper levenshtein distance. Am I allowed to revise? – Adam Katz – 2015-08-15T04:43:06.090

Editing code in a cops-and-robbers post (especially when cracked) is not allowed, but you can always post a new answer. – Dennis – 2015-08-15T04:44:20.043

nm, cat's out of the bag. accepting. – Adam Katz – 2015-08-15T04:44:22.860

1

Cracked

Python 3, 57 bytes

Code:

import math, decimal
print(decimal.Decimal(math.tan(749)))

Output:

3.615402552802641888973766981507651507854461669921875

Changed Output:

0.6610431688506868130872362598893232643604278564453125

Beta Decay

Posted 2015-08-11T08:11:19.767

Reputation: 21 478

Cracked? – Dennis – 2015-08-15T14:42:04.643

1

Cracked

APL, 4

Code

9⍟99

Original Output

2.091329169322069

Changed output

0.11111111111111112

Tested here. Note that the last digit is 2. I just wanted to know how hard is an average APL submission.

jimmy23013

Posted 2015-08-11T08:11:19.767

Reputation: 34 042

Cracked – Dennis – 2015-08-16T17:11:31.750

0

JS,

Math.pow(2,10)

Original output:

1024

Changed output:

7.61773480458663923e+85

Has a Levenstein distance of 23(!).

akfhkjgdhfvkcjhzr3

Posted 2015-08-11T08:11:19.767

Reputation: 1

0

Cracked

Pyth, 4 bytes

.!77

Output:

145183092028285869634070784086308284983740379224208358846781574688061991349156420080065207861248000000000000000000

Changed Output:

3628800

Beta Decay

Posted 2015-08-11T08:11:19.767

Reputation: 21 478

Cracked – isaacg – 2015-08-14T08:34:00.403

0

Cracked

Python 2, 86 Bytes

Original Code

import dis
def torun():
 print "hello world"
try:
 print dis.dis(torun)
except:
 pass

Original Output:

 47           0 LOAD_CONST               1 ('hello world')
              3 PRINT_ITEM          
              4 PRINT_NEWLINE       
              5 LOAD_CONST               0 (None)
              8 RETURN_VALUE        
None

Changed Output:

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

rp.beltran

Posted 2015-08-11T08:11:19.767

Reputation: 281

In Python 3, those print statements will cause syntax errors. – isaacg – 2015-08-14T19:53:10.370

Cracked – Dennis – 2015-08-14T19:54:58.023

Good job. At least I learned how to use dis in the process of making this one. – rp.beltran – 2015-08-14T20:27:51.043

0

C, 82 bytes

b=64,i,x[64];main(){for(i=b;i--;)x[(i*3)%b]^=x[(i*5)%b]+i,printf("%02u",x[--b]);}

Output 1:

00006362616059585756555453525150494847464544434241403938373635343332313029282726252423222120191817161514131211100908070605040100

Output 2:

000000006312518624630536342047653158563869074179184088893598110261070111311551196123612751313135013861421145514881520155115811610163816651691171617401763178518061826184518631880189619111925193819501961197119801988222001201400

rr-

Posted 2015-08-11T08:11:19.767

Reputation: 273