Two Makes All The Difference - Robbers

29

1

For the main cops' challenge, click here

NOTICE - This challenge is now closed. Any cracks which are posted now will not be counted on the leaderboard and the accepted answer will not change.

Challenge

Given the original program, its output and the output of the changed program, you have to find out which characters need to be changed, removed or added to get the expected output.

When you crack someone's code, leave a comment with a link to your crack on their answer.

Formatting

# [<language>, <username of program owner>](<link to answer>)

## Description

<description of change and how you found it>

## Code

<changed code>

Winning

The person who has cracked the most solutions wins.

Leaderboard

13 cracks:

  • Dennis

8 cracks:

  • Alex Van Liew

5 cracks:

  • Sp3000
  • isaacg

3 cracks:

  • Luis Mendo
  • jimmy23013
  • Dom Hastings

2 cracks:

  • mbomb007
  • Sluck49

1 crack:

  • TheNumberOne
  • Jakube
  • ProudHaskeller
  • David Zhang
  • samgak
  • paul.oderso
  • rayryeng
  • mgibsonbr
  • n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳
  • Stewie Griffin
  • abligh

Beta Decay

Posted 2015-08-11T08:13:45.793

Reputation: 21 478

1@mbomb007 Can you refrain from editing this post, because it makes it harder for me to know where I am when updating the leaderboard – Beta Decay – 2015-08-13T20:25:37.220

Answers

10

CJam, by Mauris

Description

Mauris' original code does the following:

"f~"     e# Push that string on the stack.
    :i   e# Cast each to integer. Pushes [102 126].
      :# e# Reduce by exponentiation. Pushes 102^126.

No other of CJam's mathematical operators would yield a number that large for small inputs, so :# cannot be modified. Since #, when used for exponentiation, only takes integers as input, :i cannot be removed as well. This leaves only one place to modify the input: the string "f~".

No matter how many characters the string holds, the result will be a left-associative power tower. CJam supports characters in the range from 0 to 65535 (with the exception of surrogates), so we have to express the output as bn×k×j, where b, n, k and j are integers in that range.

The decimal logarithm of the integer that results from the modified code is slightly smaller than log10(2.44×10242545) = log10(2.44) + 242545, so we can divide this value by the logarithms of all possible bases to find proper values for n×k×j.

In fact:

$ cjam <(echo '65536,2>{2.44AmL242545+1$AmL/i:I#s8<"24399707"=}=SIN')
5 347004

Comparing the first 8 digits turned out to be sufficient.

This means that we can express the output as 5347,004 = 1562557,834 = 1259×102×126, so it suffices to replace "f~" with "㴉" or "} f~".

Code

"㴉":i:#

or

"}  f~":i:#

Note that the spaces in the ASCII code should actually be a tabulator.

Attempting to execute this code in the online interpreter is probably a bad idea, but here's how you can verify the results from the command line:

$ wget -q https://bpaste.net/raw/f449928d9870
$ cjam <(echo '[15625 57834]:c`":i:#") > mauris.cjam
$ cat mauris.cjam; echo
"㴉":i:#
$ cjam mauris.cjam | diff -s - f449928d9870
Files - and f449928d9870 are identical
$ echo -en '"}\tf~":i:#' > mauris-ascii.cjam
$ cat mauris.cjam; echo
"}  f~":i:#
$ cjam mauris-ascii.cjam | diff -s - f449928d9870
Files - and f449928d9870 are identical

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

11One does not simply beat Dennis in CJam – Fatalize – 2015-08-11T20:10:03.277

How did you figure out what numbers to use? – Alex Van Liew – 2015-08-11T20:13:36.593

@AlexVanLiew Brute force. I'm currently writing an explanation. I just wanted to get the crack posted before somebody else did. – Dennis – 2015-08-11T20:14:14.053

@Dennis: Fair enough. I was trying this one but I don't know CJam; I figured the intended solution involved actually using ~f somewhere in the program. – Alex Van Liew – 2015-08-11T20:16:12.137

I hadn't really accounted for Unicode characters -- the PPCG tradition seems to be to count bytes, not characters. As such, there's a solution that doesn't use any. I suppose this counts, though? I'll let the OP decide. – Lynn – 2015-08-11T20:18:19.050

1@Mauris The question says *when just two characters in the program are changed* (emphasis mine), so I assumed this was OK. Anyway, factorizing the number was the hard part. – Dennis – 2015-08-11T20:23:11.230

Hooray, you found it! Very nice job. – Lynn – 2015-08-11T20:28:43.807

@AlexVanLiew I've edited my answer. – Dennis – 2015-08-11T20:52:30.157

@Dennis: Very cool. – Alex Van Liew – 2015-08-11T21:07:53.707

15

Ruby, histocrat

Description

Changed x to be an array instead of scalar by adding *

Changed the last 9 to be a string instead of a number by adding ?

The result is made of an array with a single element ([9]) multipled 9 times then imploded with "9" as separator.

Code

x=*9;puts x*9*?9

Razvan

Posted 2015-08-11T08:13:45.793

Reputation: 1 361

12

Python 2, muddyfish

Description

Through trials and tribulations involving factorizing large numbers and looking for consequtive factors, I realized that changing the 87654 to 58116 would be enough. Then, I factorized 58116 as 87*668. Then I realised that 01234 = 668, so I just needed to change 87654 to 87 and remove the 01234 entirely. This is accomplished with a comment.

Code

print (sum(range(054321)*9876)*87)#654)/01234

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

Yep, almost exactly how I had it (Mine was print sum(range(054321)*9876)*87#654)/01234) – Blue – 2015-08-12T07:32:15.087

Clever clever! I'm glad someone got it, and that it was more interesting than "play with numbers"! – Alex Van Liew – 2015-08-12T16:48:40.860

11

Shakespeare, AboveFire

In Scene III, one has to change Claudius into Claudio in the following snippet:

[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]

Modified 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]

Claudio:
 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]

Using the compiler linked by @AboveFire, this prints 11.

plannapus

Posted 2015-08-11T08:13:45.793

Reputation: 8 610

2Can you please make it more clear which characters were changed? It's not exactly easy to see looking back and forth. – mbomb007 – 2015-08-13T15:55:48.710

Damn, 15 minutes late. Congratulations. – Sumyrda - Reinstate Monica – 2015-08-13T15:56:50.030

2Jeebus H. Christ. Nice job! – rayryeng - Reinstate Monica – 2015-08-13T16:16:32.183

I figured it had to be something like that; it seemed unlikely (and downright cruel) to make the two characters in a noun or adjective somewhere. Somehow, though, I think the poeticism is much better in the original... – Alex Van Liew – 2015-08-13T16:36:48.780

I am damn sad :'( I put the names of the variables similar to lead you on a wrong track. I was sure I made it so it was only possible in the way I designed it, but you found another way... Well you got it xD I confirm that you cracked the code successfully. – AboveFire – 2015-08-13T16:55:29.440

1@mbomb007 I hope my edit made it clearer. AboveFire: sorry :) – plannapus – 2015-08-14T06:39:19.673

3@plannapus Haha, it's okay, but the intended way to clear it was to replace the word "king" by "pig".With this change, Helena was equal to 0 and "the sum of thee and the product of the product of me and Helen and Helena" was equal to 1. I had made a list of all words that could be inverted with two letters and used a lot of them in my code(ex: joy->hog->son, war->cat, road->toad, Hero->Hell, curse->purse, helen->helena, claudio->claudius and many others) The only things that can change a Shakespeare program with 2 char is the change of a variable, the change of a noun and the change of a goto. – AboveFire – 2015-08-14T11:39:37.400

That was way trickier indeed :) – plannapus – 2015-08-14T11:44:49.080

Good work. its nice to see I too was on the right track when i gave it a try :) - again, good work @plannapus – Alex Carlsen – 2015-08-20T10:04:08.623

10

Prolog, Fatalize

Description

Add two \s. \ is bitwise negation and \/ is bitwise or.

Code

X is \1\/42.

Sp3000

Posted 2015-08-11T08:13:45.793

Reputation: 58 729

Correct solution – Fatalize – 2015-08-11T15:18:59.903

8

MATLAB/OCTAVE, Stewie Griffin

A simple bit of complex arithmetic.

acos(i)

David Zhang

Posted 2015-08-11T08:13:45.793

Reputation: 348

7

C, LambdaBeta

Description

Turn main(a,_) into main(_). The first argument of main is argc which is initialized as 1.

Code

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

TheNumberOne

Posted 2015-08-11T08:13:45.793

Reputation: 10 855

That's the solution I had in mind. Nice catch. Incidentally if the argv happens to be loaded into memory cell 1 this will not work. I just can't think of any system that would do that that can also run the various interpreted languages on that page. – LambdaBeta – 2015-08-11T15:50:20.133

6

Python 2, rp.belrann

Change the outermost list comprehension into a set comprehension. Partial credit to @mbomb007, who eliminated all of the "boring" solutions (swapping x and y around, tweaking operators, changing the range).

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

Explanation:

In the original, [(x,y)[x%2]for x in[y for y in range(8)]] generates the following list:

[0, 7, 2, 7, 4, 7, 6, 7]

This is because in Python 2.7, the y in the inner list comprehension leaks into the enclosing scope at it's last known value (which, at the end of a range, is 7). So, in the tuple, y is always 7. x, however, goes through the list as normal, ranging from 0 to 7. When x is even, it chooses the value of x, when it's odd, it chooses y (which is always 7). I noticed that if I included exactly one 7 and all the rest of the values of x, I got 19; then I realized that I could transform the outer comprehension into a set comprehension, which would eliminate all duplicate values and leave me with exactly 19.

This was pretty clever, I don't think I've ever used a set comprehension before. Kudos.

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

nope. That's not it. print len('~'*sum([(x,y)[x%2]for x in[y for y in range(6)]])) returns 21. Just assign the code to a variable then print if it equals the string you want. If you see True, you cracked it. – mbomb007 – 2015-08-13T16:40:38.413

Bizarre. _ betrayed me, I guess. – Alex Van Liew – 2015-08-13T16:45:40.470

@mbomb007 I got it. – Alex Van Liew – 2015-08-13T16:53:49.953

You got me. Well done. – rp.beltran – 2015-08-13T17:01:53.610

6

Jonas, Matlab/Octave

Description

I noticed the answer was i^pi, so then I justed had to turn sin into a nop.

Code

0i+(i^pi)

s -> 0, n -> +

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

Nicely done sir. – rayryeng - Reinstate Monica – 2015-08-13T21:28:26.437

Very well done!! – Luis Mendo – 2015-08-13T21:46:31.510

5

Bash, Dennis

Original code:

echo {{{1..9}}}

Original output:

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

Modified code:

echo {,{1..9},}

Modified output:

1 2 3 4 5 6 7 8 9

Explanation:

In Bash you can output a comma separated list of items inside a pair of braces, like this:

echo {a,b,c}

prints

a b c

So the modified code is printing out a list of nothing, the numbers 1..9, nothing.

samgak

Posted 2015-08-11T08:13:45.793

Reputation: 1 577

5

MATLAB, Luis Mendo

Original code:

-sin(2:.5:3)    
ans =    
   -0.9093   -0.5985   -0.1411

New answer:

psi(2:.5:3)
ans =
    0.4228    0.7032    0.9228

Description:

Changed -sin to psi, the polygamma function in MATLAB. The - sign is substituted by p and the n is removed.

Stewie Griffin

Posted 2015-08-11T08:13:45.793

Reputation: 43 471

4

Brainfuck, Kurousagi

Description

Remove the first > and change the first < to .

Tested at brainfuck.tk. Note that the output doesn't match Kurousagi's post exactly, due to SE eating up unprintable characters.

Code

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

Sp3000

Posted 2015-08-11T08:13:45.793

Reputation: 58 729

@muddyfish I linked this answer in my second comment, but I'm still awaiting confirmation from Kurousagi – Sp3000 – 2015-08-11T13:23:04.697

4

C, LambdaBeta

Description

Change -1 into *0 so that the result of the multiplication is 0 (a falsy value).

Code

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

Jakube

Posted 2015-08-11T08:13:45.793

Reputation: 21 462

Oops, looks like I introduced a (security flaw?) during my golfing. I'll idly mull it over to see if I can fix it. Nice catch though. – LambdaBeta – 2015-08-11T13:33:21.757

4

Fantom, Cain

Security through obscurity is a very poor form of security (especially when the two methods are right next to each other in the Fantom docs and anyone who knows what a float looks like will immediately know what to do).

Float.makeBits32(1123581321)

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

1You got me by 1 min !!! well played – AboveFire – 2015-08-11T19:16:14.120

1Haha you got me, enjoy the free crack – Cain – 2015-08-11T20:10:29.173

@Cain Was that intentional o.o – The_Basset_Hound – 2015-08-12T00:29:58.247

1@BassetHound I mean, it was more of a social experiment, to see if people would bother learning some obscure language for the crack. I should have made it harder though, to take some actual work. – Cain – 2015-08-12T04:44:27.543

4

CJam, by Basset Hound

25me

Calculates e25. Try it online.

The online interpreter gives a slightly different result in my browser, which seems to be a rounding issue.

The Java interpreter prints 7.200489933738588E10, which is the desired output, but in a different format.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Hehe, it was easy. Especially for a CJam god. Correct. – The_Basset_Hound – 2015-08-11T22:22:59.557

4

Python 2, Sp3000

Description

Changed 01234 to 0x1234 and min to 9in.

The fact that 4669 = (01234-1)*sum(m<<m in R for m in R) is misleading.

Code

R=range(0x1234);print sum(m<<9in(m,n)for m in R for n in R)

jimmy23013

Posted 2015-08-11T08:13:45.793

Reputation: 34 042

Nicely done! I had m<<m in(m,n), but the main thing was to change the min to in. – Sp3000 – 2015-08-13T00:33:34.620

4

MATLAB / Octave, Stewie Griffin

Description

This required negating the input into the anonymous function g, as well as changing the scaling factor of the g function to 2 instead of 7:

Code

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

ans =

  -0.3011 - 0.4144i

rayryeng - Reinstate Monica

Posted 2015-08-11T08:13:45.793

Reputation: 1 521

Thanks for your comment on my (now deleted) answer. I posted a new (very similar) one that can be cracked using WolframAlpha. I believe it's fairer. – Dr. belisarius – 2015-08-13T17:03:13.167

4

Perl, abligh

Description

Add in string repetition operator, x and insert additional digit!

Code

print sin 95x7

Dom Hastings

Posted 2015-08-11T08:13:45.793

Reputation: 16 415

3

Java, TheNumberOne

Description

The program is a one-off implementation of Random.next() with a initial seed of Integer.MAX_INT and all the hex numbers converted to decimal. Changing the seed to the complement of MAX_INT generates the output:

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

(since there must be exactly two changes, pick any sort of no-op change: adding a space somewhere, an extra semicolon, etc)

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

1Nice, You could have also turned Integer.MAX_VALUE into Integer.MAX_VALUE+1 or Integer.MIN_VALUE – TheNumberOne – 2015-08-11T17:42:22.373

Oh, you know what? I tried +1 but since I was doing it in Python it just rolled over to a long, ahaha. That was my first thought, actually. – Alex Van Liew – 2015-08-11T18:04:13.177

3

Brainfuck, AboveFire

this program is a modification of this code me a cookie answer. that answer works by first pre-calculating a table of useful ascii codes of useful characters, and then has three conditional statements made up by three loops which are entered to by having a 1 in the correct position.

the start of how i broke the code is that the repeating pattern in the changed output is mostly what is printed if you enter the third loop with the table shifted left.

++++++++++[->++++++++<]>>++++++[-<---------->]<-------[----------->>>-<<+<[->->+<<]]>>>+<<>>>+++[->++++++++++<]>(<)++ .<+++++++++[->>>>>>>++++++++++<+++++<++++++++++++++<++++++++++<+++++<++++++++++<<]++++++++++>>+++++...>++>++>-->+>(>)++++<<<<<<<.<<<[->>>>>>.<<>>>>>.<<<<<.>>>>>.<<<<<>>>.<<<<.>>>>>.<<<<.>>>>>.<<<<<.>>>>.<<<<<.>>>>.<<...>.<<<<<<]>[->>>>>.<<...>>>.<<<<.>>>>>.<<<<...>>>>.<<<<<.>>>>.<<...>.<<<<<]>[->>>>.<<>>>>>>.<<<<<<..>>>.<<<<.>>>>>.<<<<>>>>>>.<<<<<<.>>>>>>.<<<<<<>>>>.<<<<<.>>>>.<<...>.<<<<]

(the additional characters are marked with parentheses)

proud haskeller

Posted 2015-08-11T08:13:45.793

Reputation: 5 866

3

Python 2, muddyfish

Description

Change << to <> (deprecated version of !=) and 0x156 to 0156, the code point for "n" (which appears 3 times in the length 23 string '<built-in function sum>').

Code

print sum((ord(i)<>0156 for i in `sum`))

Sp3000

Posted 2015-08-11T08:13:45.793

Reputation: 58 729

3

JavaScript, by Razvan

Description

The modified output is clearly Euler's natural number, which can be accessed as Math['E'].

By changing '' to '3' and 32 to 36, String.fromCharCode generates the E.

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='3'+c*d['length']*d['length'];alert(Math[String.fromCharCode(i.charCodeAt(0) * i.charCodeAt(1) / 36)])

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Yes, that's correct. Still it was actually something deeper but it seems that you could bypass it with this trick. I'll think of something else and I'll come back. – Razvan – 2015-08-12T22:26:12.893

3

Fantom, Cain

Description

The array indexing is set up already, so I just need to make a 55. Honestly, the hardest part was downloading the language.

Code

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

(Inserted a comma, 0 -> 3)

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

Well crap, that wasn't the intended solution, my red herring was an actual solution – Cain – 2015-08-13T01:36:05.337

3

Shakespeare, AboveFire

NOT CORRECT - sorry :(

Will look further into it when i get home from work In the original Claudio's value is 1132462081 and Claudius' value is 1

In the final Scene Claudio's value is printed twice,

[Enter Claudio]

Claudius:
 Open your heart!
 Open your heart!

open your heart x2 = print value of the other person on stage (Claudio). So if you change Claudius to Claudio(2 chars) - the value of Claudius will be printed - which is 1 - twice

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]

Claudio: << changed Claudius to Claudio
 Open your heart!
 Open your heart!
[Exeunt]

Alex Carlsen

Posted 2015-08-11T08:13:45.793

Reputation: 387

Nope, Claudio value is not 1 xD. Better luck next time. – AboveFire – 2015-08-13T11:31:05.447

@AboveFire - crud.. I'll have another look at it when i get home, really thought I had it :( – Alex Carlsen – 2015-08-13T11:33:04.007

That was my first guess, too, but I didn't have a chance to try it, yet. Anyway, the only part I didn't understand yet is the one with the archbishop so I'll have a look at that when I get home. – Sumyrda - Reinstate Monica – 2015-08-13T12:07:52.627

3

Matlab / Octave, Jonas

Description

In the last line, add ' to transform arg' into the string 'arg', which will then be interpreted as ASCII numbers. And then add another ' at the end to maintain the column format.

The almost unnecessary ' in the original code was the main clue. Also, in restrospect, the fact that arg was defined separately (instead of directly within the sin line) should have looked suspicious.

Code

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

Luis Mendo

Posted 2015-08-11T08:13:45.793

Reputation: 87 464

3

VBA by JimmyJazzx

Changed IRR to MIRR and changed 5 to a , so there are 3 parameters.

I found this while looking for how Excel's IRR function works. There was an article: How Excel's MIRR Function Can Fix the IRR Function. That tipped me off. Clever attempt, though. I'd never used VBA before, so that was interesting as well.

Sub q()
Dim a(2) As Double
a(0)=-5
a(1)=10
msgBox MIRR(a,0.2,3)
End Sub

mbomb007

Posted 2015-08-11T08:13:45.793

Reputation: 21 944

Nice. Technically i added both the M and the , so the middle arg was 0.25 but i think they end up having the same result anyway. Thought using some finance functions could stump the programmers but was revealed by the documentation. Good job – JimmyJazzx – 2015-08-13T17:22:05.990

3

bc, abligh

Merely inserted the math operators. Took about 1 minute to solve once I looked up what bc was and what math operations it had. The first thing I thought of was division, but there weren't common factors that looked nice. So I immediately went for exponentiation and modulus. At least 15 digits were necessary for the modulus b/c of the expected output. After that, I guessed twice and found it.

4518^574%615489737231532

mbomb007

Posted 2015-08-11T08:13:45.793

Reputation: 21 944

3

Lua, TreFox

Description

"_G" is the global table, making "_G.load" refer to the global function "load". Converting a function to a string results in returning the function's address, which is then made into the length of the string by the length-operator "#".

Code

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

Also, since this is my first post on here, I can't make a comment on the original answer.

Xrott

Posted 2015-08-11T08:13:45.793

Reputation: 131

I've left a comment on the cop answer. By the way, this doesn't quite work for me. The address is I get is 0x321a40c6d0, for a final output of 22. – Dennis – 2015-08-14T03:35:35.653

I am not sure why you are getting 22... on everything I tested it was 18 or 26. – Nico A – 2015-08-14T11:29:06.113

@Dennis Try it in the official lua demo.

– Xrott – 2015-08-14T13:10:03.780

Aha, I was so close! I knew I needed the global load, and I knew _G referred to the global symbol table... I just didn't put the two together. – Alex Van Liew – 2015-08-14T16:39:43.173

3

Python, rp.beltran

Description

I noticed that the needed letters were always 2 in front of a digit. changing the third \w to \d got all of the right letters except the spaces. \D was the only \ group I could find that allowed letters and spaces.

Code

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

w -> D, w -> d in the regex.

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

3

Pyth, isaacg

Description

The original code does the following:

 CG      Convert "abcdefghijklmnopqrstuvwxyz" from base 256 to integer, yielding
         156490583352162063278528710879425690470022892627113539022649722.
   ^3y21 Compute 3^(2 * 21).
%        Calculate the modulus.

Since 156490583352162063278528710879425690470022892627113539022649722 - 58227066 gives 156490583352162063278528710879425690470022892627113538964422656, which equals 226 × 3 × 7 × 7477 × 381524422711 × 17007550201751761 × 2288745700077000184147, the desired output can be obtained by replacing ^3y21 with something that evaluates to a divisor of this product and is larger than 58227066.

The ^ in the original code suggests that we might use it to calculate a power of 2, the 3 that we could calculate a fitting divisor of the form 3 × 2n.

Both are misleading. Solutions with a Levenshtein distance of 3 (%CG^2 26, %CG^y2 13, %CG^4y13) or 4 (%CG.<3y13) are readily found, but the solution at distance 2 requires a different approach.

The lowercase alphabet (G) has 26 letters, so its power set (the set of all strictly increasing sequences of lowercase letters) has 226 elements. By replacing y2 with yG, we compute this power set.

We can retrieve the set's length by replacing 3 with l, which leaves us with ^lyG1, i.e., 226 raised to the first power.

Code

%CG^lyG1

Note that this will only work on a computer with enough available memory (roughly 6.43 GiB, according to time), so it will not work with the online interpreter.

Here's how you can verify the results from the command line:

$ \time -v pyth -c '%CG^lyG1'
58227066
        Command being timed: "pyth/pyth.py -c %CG^lyG1"
        User time (seconds): 30.73
        System time (seconds): 2.12
        Percent of CPU this job got: 100%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:32.85
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 6742564
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 2269338
        Voluntary context switches: 1
        Involuntary context switches: 58
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Correct! Well done. – isaacg – 2015-08-15T00:41:54.160

2

C++, f41lurizer

Good old trigraphs.

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

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

g++ won't accept the trigraph without additional compiler flags. Removing the newline should work with all compilers. – Dennis – 2015-08-11T22:11:01.703

Heh, I suppose that does work, huh? I'm pretty sure this was the intended solution, but it doesn't really matter since the original is invalid anyway. – Alex Van Liew – 2015-08-11T22:29:09.427

2

Python 2, muddyfish

Description

Change `i` to `id` = '<built-in function id>' and 1234 to 01234 (octal). Found by recalling the wise words of Sir @xnor (paraphrased): "If you ever need a string that's 22 chars long..."

Code

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

Sp3000

Posted 2015-08-11T08:13:45.793

Reputation: 58 729

2

VBA, JimmyJazzx

Description

First of all the call of a(2) was strange since only a(0) and a(1) get used, that was actually a big hint.

Next i looked into what the function IRR really does (see here). There is no combination of integer a(0) and a(1) that can possibly yield the modified output.

So I looked for combinations of a(0) and a(2) (<- first character changed) that resulted in the desired output and found a(0) = -1 and a(2) = 8. Since multiplying a(0) and a(2) with the same number doesn't change the outcome I simply multiplied both with 5 so a(0) would stay the same.

Code

Sub q()
Dim a(2) As Double
a(0) = -5
a(2) = 40
MsgBox IRR(a, 0.253)
End Sub

paul.oderso

Posted 2015-08-11T08:13:45.793

Reputation: 61

Though this may yeild the correct result this is not what I had done. mbomb007 did get what i had done correct.

Good try though and im not sure which one the judge will accept as this one did come in first and ends up with the same result as the real answer.

As for the a(2) that was there to mislead people, as it took the same amount of bytes as a(1) would have. But wanted to keep people away from seeing what IRR really does. – JimmyJazzx – 2015-08-13T17:50:28.323

2

Clojure, Bob Jarvis

Base conversions are fun.

(printf "%d\n" 7r2155263413256326162)

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

2

PHP, Ismael Miguel

print_r(range(1,07));

I guess it really was that simple.

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

Yup, it was that simple. I didn't put that much effort on it, I was just warming up. – Ismael Miguel – 2015-08-12T21:35:27.270

PHP could be a great language for this challenge because of all the wonky stuff it's got in there. – Alex Van Liew – 2015-08-12T21:37:11.920

Yeah, I think I will come up with something – Ismael Miguel – 2015-08-12T21:37:42.640

2

modern Perl 5, msh210

Description

The s/// call has to only apply to the first element in the @array and using each with the for covers it off!

Code

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

Added space in between for and each. I

Dom Hastings

Posted 2015-08-11T08:13:45.793

Reputation: 16 415

1

Works in ideone. You can just add an arbitrary space for the second changed character.

– Alex Van Liew – 2015-08-13T02:10:49.617

2

Matlab/Octave, paul.oderso

Description

I took the natural log, and recognized it as near pi ^ 2. From there it was easy.

Code

e^(pi*pi)+2

Added a p, 1 -> 2

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

2

MATLAB, Jonas

Description

Change 1+1 to 49+1. I don't actually have MATLAB so I can't test this, but the number looks right

Code

sin(49+1)

Sp3000

Posted 2015-08-11T08:13:45.793

Reputation: 58 729

yes - thought that's not what I had in mind. – Jonas – 2015-08-13T12:46:27.677

1@Jonas: What was the hard solution? Do you mind sharing? – Stewie Griffin – 2015-08-13T12:46:56.660

@StewieGriffin: Here's a better version of the question instead: http://codegolf.stackexchange.com/a/54625/18

– Jonas – 2015-08-13T12:57:20.857

2

Matlab / Octave, Jonas

Description

Just change tragic by magic in the second line.

tragic is a symmetric, integer-valued matrix. The difference between both inputs is integer-valued but not symmetric. So a new kind of matrix was needed. The integer values and the name traffic looked familiar.

Code

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

Luis Mendo

Posted 2015-08-11T08:13:45.793

Reputation: 87 464

1I guess I should have put a call to det in there to make it harder, but I wanted this to remain fun (also, det doesn't easily fit into a sentence) – Jonas – 2015-08-13T16:33:55.190

1

A magic mistake, eh?

– Alex Van Liew – 2015-08-13T17:02:39.157

@Jonas Yes, with det it would have been much harder – Luis Mendo – 2015-08-13T18:51:24.890

2

Wolfram Language Mathematica or WolframAlpha, belisarius

Original Code

8.!

Changed Code

8.^i!

Original Output

40320.

Changed output

2.67182 - 0.891969 I

abligh

Posted 2015-08-11T08:13:45.793

Reputation: 777

2

GolfScript, Dennis

Description

9,:n9 doesn't work because n9 would be one variable name. In GolfScript you usually get rid of this by using a symbol as the variable name, so...

Code

9,: 9

More explanations.

jimmy23013

Posted 2015-08-11T08:13:45.793

Reputation: 34 042

1Did... Did you assign something to the space character? – Alex Van Liew – 2015-08-14T16:48:13.527

@AlexVanLiew Yes. The full program executed would be 9,:space 9]print space n space print. – jimmy23013 – 2015-08-14T18:54:40.620

That's amazing. – Alex Van Liew – 2015-08-14T20:20:41.613

2

JavaScript, Razvan

Description

Changed 1 to .1 and added a semicolon.

Code

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

jimmy23013

Posted 2015-08-11T08:13:45.793

Reputation: 34 042

Yes! That's what I had in mind. – Razvan – 2015-08-14T08:20:05.117

2

PHP, Razvan

Description

Inserted ( and ), so $T_I_(M_E * $A_U_T_U_M_N) executes TAN(M_E * 2), where M_E is Euler's natural number.

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

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

2

Ruby, histocrat

Description

Need to make the regex at the end work on the string literal ?9 so we need to make the variable $_ instead of _, also need to start the regex itself. Didn't realise that you could omit the {} when interpolating variables into regex in ruby.

Code

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

Dom Hastings

Posted 2015-08-11T08:13:45.793

Reputation: 16 415

1Confirmed working on ideone (Ruby 2.1.5), but it doesn't work on my machine (Ruby 2.1.5). Odd. – Dennis – 2015-08-15T15:32:20.060

Nice one. works fine for me in ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] – gnibbler – 2015-08-15T17:45:26.787

2

Octave, Daniel

Description

111 is the code point of the ASCII character o, so the desired output can be achieved by replacing cos with "o".

(1) retrieves the first character of the string and *1 casts to integer.

Code

format long;
"o"(1)*1

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

2

APL, Mauris

Description

This was pretty much trial and error. I knew I had to insert a ¯ (negative number) and use mathematical functions like (trigonometic) or (logarithm) that yield complex number for negative input, or directly insert a J (imaginary part).

After a lot or errors, I finally tried inserting a ¯ before 7 and a before /.

Code

-⍟/3⍴15¯7

Try it online in ngn/apl demo, the online interpreter recommended by the cop.

Note that this won't work in, e.g., Dyalog APL, which requires a space before the high minus.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Wow, you just don't stop! :O – Beta Decay – 2015-08-15T21:07:25.350

2

APL, Mauris

Description

Unlike the two APL answers I cracked before, the indented output of this one reveals very little about the required changes, so I decided to try a brute force approach.

Two characters aren't enough for loops, so the added characters (if any) had to be parts of numeric literals, mathematical functions or .

I chose a subset and hoped I'd get lucky. Using this CJam script, I generated all source codes (many of them with syntax errors) at an edit distance of 2 or less that only add character from the chosen set. This yielded 28,014 different potential solutions.

Aside from the online interpreter, ngn/apl is available for NodeJS. It even has a command-line flag (-l) that executes code linewise, which is almost perfect for this purpose.

After a minor change that condensed error output to a single line, I was able to grep the output to find the line number of the correct source code. The interpreter powered through the roughly 28,000 possible solutions in less than 6 seconds.

This sums up what I did:

$ diff apl.js `which ngn-apl`
4806c4806
<                       return e + '\n';
---
>                       return ('' + e).replace(/\n/g, '') + '\n';
$ cjam gen-edit-dist-2.cjam > brute-force.apl
3⍟877
0123456789.¯+-÷×⌈⌊*!|⍟○⊥⊤⍨
$ wc -l brute-force.apl 
28014 brute-force.apl
$ time ngn-apl -l < brute-force.apl | grep -n '0\.2001649'
3791:0.20016493054644696
20128:0.20016493054644696

real    0m5.506s
user    0m5.516s
sys     0m0.252s
÷3⍟○77
3⍟⍨○77

This reveals two possible solutions: replacing 8 with and inserting ÷ before 3, or replacing 8 with ⍨○.

Code

÷3⍟○77

or

3⍟⍨○77

Try them online in the ngn/apl demo.1

These modifications calculate 1 / log3 77π = log77π 3, which yields the desired output.


1 Note that the last digit may be a 3 on some machines.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Nice work. But if the digits change from browser to browser that is a huge problem... Maybe jimmy23013's 4 byte APL cop is impossible in some environments simply depending on floating point rounding – Lynn – 2015-08-16T17:47:48.440

This seems to be a simple 32 vs 64 bit issue. jimmy23013's modified code works on my desktop and my phone, so it doesn't seem to have the same issue. Writing truly platform-independent code should pretty much be impossiboe once you involve fixed width floats... – Dennis – 2015-08-16T18:13:41.490

1

PHP, Dom Hastings

Comment out the first two lines so they all append together.

define('E','!');

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

print($t);

Nathan Merrill

Posted 2015-08-11T08:13:45.793

Reputation: 13 591

Not quite, I get: Hello World!tt... UsingPHP 5.4 if that makes a difference... I'll update the other with the version. – Dom Hastings – 2015-08-12T12:11:34.260

1

Lua, TreFox

In Lua, # is the "sizeof" operator. The discrepancy in the original behavior (15 or 23) is because the solution involves the size of the string created by converting a table to a string, and that string contains the address of the table (which is 16 characters on a 64-bit system and 8 on a 32-bit system). It looks like the particular distribution TreFox has is 64-bit. Also, apparently arguments in Lua work like arguments in Javascript, in which they don't seem to care how many arguments are passed, so changing the . to a , only causes G to be printed.

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

Secretly, I think this challenge was designed to make you think about skimpy underwear the whole time you were working on it.

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

1

Matlab / Octave, rayryeng

Description

Change eig to eigs and sin to sind.

The main clue was that the modified output has six eigenvalues sorted by magnitude, which is what eigs returns.

Code

eigs(cov(reshape(sind(1:60),5,[])))

Luis Mendo

Posted 2015-08-11T08:13:45.793

Reputation: 87 464

2Very well done! How long did that take you to figure out? :) – rayryeng - Reinstate Monica – 2015-08-12T22:46:29.317

2

It took quite a while... but I see now that the main clue had already been given in Matlab's chat room !

– Luis Mendo – 2015-08-12T23:34:04.737

1

SWI-Prolog, Fatalize

Description

Replace an E for an F (or the other way around) and change a single digit in one of the numbers input.

Code

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

mgibsonbr

Posted 2015-08-11T08:13:45.793

Reputation: 121

1That's not how I did it, but that works nonetheless! Well done. The way I did it was changing d(123456,123456) to dif(123456,123456), to call the builtin predicate dif/2 which returns false if its two arguments are the same. – Fatalize – 2015-08-13T05:17:15.557

1@Fatalize I really wish I've seen this earlier :P – mgibsonbr – 2015-08-13T05:47:37.350

1

SWI-Prolog, mgibsonbr

Description

Change , (conjunction) to ; (disjunction).

Add a space to make the distance 2.

Code

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

n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳

Posted 2015-08-11T08:13:45.793

Reputation: 5 683

1

JavaScript, Razvan

Description

The changed output being 10/3 was a dead giveaway.

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 = 10 / numbers['length'];
alert(infinity);

SLuck49

Posted 2015-08-11T08:13:45.793

Reputation: 901

No worries - I had == in the for loop, but yeah 10/3 was a dead giveaway :) – Sp3000 – 2015-08-13T13:15:38.917

Correct, I didn't notice this obvious solution. – Razvan – 2015-08-13T13:17:59.170

1

Pyth, Beta Decay

Description

This one's just obvious.

Code

.!10

77 -> 10

isaacg

Posted 2015-08-11T08:13:45.793

Reputation: 39 268

Actually, I went for .!&77T. I guess I didn't really give it much thought ;) – Beta Decay – 2015-08-14T12:35:58.077

1

CSS, Qwertiy

Description

After seeing that the first number was a zero what needed changed seemed pretty clear

Code

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

SLuck49

Posted 2015-08-11T08:13:45.793

Reputation: 901

1

Stuck, Vioz-

Change the first two numbers both to 3.

3R3R3R4R5R6R7R8R9R9z]

Zipping in Stuck works like zipping in Python (I imagine z is backed by zip()), which is the shortest sequence is taken as the max length. Without the ], the output is a list of tuples, and I don't really know what ] does. Pops the list at the top of the stack and pushes everything in it onto the stack, it looks like.

@Vioz-: Particularly for your scipy module, you should make sure that if the numpy or scipy libraries aren't available it doesn't crash with ImportError, but rather defines any methods that module supplies to just raise NotImplementedError or something similar. Also, you probably shouldn't commit .pyc files to your repo.

Alex Van Liew

Posted 2015-08-11T08:13:45.793

Reputation: 473

Nice! My solution was actually 12R3R4R5R6R7R8R9R8z] (remove the first R, change the last 9 to 8). I guess I didn't think of the obvious solution :P. Also, thanks for the tips, I'm sort of new to this whole "my own language thing". ] just pops each element from the top list of the stack and adds it to the stack. I don't think I said that clearly in my explanation. – Kade – 2015-08-14T18:49:21.743

@Vioz- You'll get the hang of it! – Alex Van Liew – 2015-08-14T20:17:58.427

1

Python, rp.beltran

Description

Changed dis to this.

import this is an easter egg which prints The Zen of Python.

Code

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

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Beat me by 30 seconds. – isaacg – 2015-08-14T19:54:37.797

Dang it. I was hoping that trick was more obscure. Good job. – rp.beltran – 2015-08-14T19:56:07.140

1@rp.beltran I mean, if you google "The zen of python"... A more obscure trick I saw in an old cops/robbers was using from __future__ import braces and some clever stuff to extract the string "chance". – Alex Van Liew – 2015-08-14T20:20:00.363

Fair point, and I figured it would get cracked pretty quickly. 2 people in 4 minutes though, I'm impressed. – rp.beltran – 2015-08-14T20:25:07.443

1

CJam, Basset Hound

Description

Finding the proper changes is easier if we work from the desired output. 5010670554118 looks like an integer in base 8 or higher.

5010670554118Ab8b
S
5010670554118Ab9b

prints 344786655312 1415926558979, and the second group of digits look a lot like the decimal expansion of Pi.

In fact, Ps pushes "3.141592653589793" (Pi cast to string), "3."- (added 3) removes all occurrences of 3 and ., i converts the result to the integer 1415926558979 and 9b (replaced 2 with 9) performs the required base conversion.

Code

Ps"3."-i9b

Try it online.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Yep, that's it... – The_Basset_Hound – 2015-08-14T20:01:55.880

1

Perl, Adam Katz

Description

$_=cos 99 saves 0.0398208803931389 in the variable $_. If we multiply this amount by 0x7275, we obtain 1166.79161639936, which is roughly 4 times the original output and 8 times the modified output.1

The original code archives almost-division-by-4 by substituting the first 3 in $_ with a 0 by executing s/[3-8]/0/, which modifies $_ and returns the number of substitutions (1), by which $_ is then divided.2

After noting that there are eight digits between 3 and 8 in the unmodified value of $_, attempting to replace all of them by appending g to s/[3-8]/0/ seemed natural, since this will divide the (modified) value of $_ by the number of substitutions.

Finally, to diminish the effect of the almost-division-by-4, it suffices to replace the first 3 (and all occurrences of 3 and 8 that follow) with a 3 by replacing s/[3-8]/0/ with s/[3-8]/3/.

Code

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

1 The code actually applies sine to $_ before multiplying, but sin x &approx; x when x is close to 0.
2 Again, this completely ignores the sine, which is almost linear near 0.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

1

APL, jimmy23013

Description

The output is obviously 1/9 with rounding errors and the code already contains a (logarithm), so using it together with * (exponentiation) seems a natural choice for introducing that error.

In fact, inserting between and 9, and * between 9 and 9 produces the intended output.

reverses the arguments of the preceding dyadic function, so this calculates log999 &approx; 1/9 with the intended error.

Code

9⍟⍨9*9

Try it online in the ngn/apl demo.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

0

Python, Beta Decay

Description

Calling math.tan on the desired ouput gives 0.777…, so it suffices to replace tan with atan and 749 with 7/9.

Code

import math, decimal
print(decimal.Decimal(math.atan(7/9)))

The output is actually 0.66104316885068692410953872240497730672359466552734375 on my machine, which rounds the (intermediate) result of math.atan(7/9) differently.

Dennis

Posted 2015-08-11T08:13:45.793

Reputation: 196 637

Yep, you got it :D – Beta Decay – 2015-08-15T15:53:47.857