6
\$\begingroup\$

V1.1: Added criterion to help with tiebreakers, a bit overkill but still.
V1.2: It's April 15th!


Task: Crack the scrambled code for calculating the argument of a complex number \$z=x+iy\$ given two inputs.

You must post a comment in the cops’ thread with a link to your working source, mentioning clearly that you have cracked it. In your answer’s title, you must include a link to the original answer.

Rules:

  • You may only change the order of the characters in the original source.
  • Safe answers cannot be cracked anymore.
  • See the other rules mentioned in the cops’ thread
  • Please edit the answer you cracked

Scoring Criterion:

  • The person who has the most cracked answers wins.
  • If there is a tie, then the total number of bytes cracked over all of the answers is taken into consideration, with the higher total byte count winning.
  • If there is still a tie somehow, then the person who posted the answers over a shorter time period wins.

Since it is April 15, it is time to announce the winner of the Robber's thread.

Most Answers cracked:

     Name        |#  answers cracked|Total bytes|Largest crack|% of total|
1st: Mukundan314 |3  answers cracked| 133 bytes |   69 bytes  |  25.09%  |
2nd: Guido       |2  answers cracked| 133 bytes |   68 bytes  |  25.09%  |
2nd: att         |2  answers cracked| 110 bytes |   57 bytes  |  10.75%  |
4th: Neil        |1  answer  cracked| 51  bytes |   51 bytes  |  09.62%  |
5th: vindobona   |1  answer  cracked| 48  bytes |   48 bytes  |  09.05%  |
6th: Greg Martin |1  answer  cracked| 31  bytes |   31 bytes  |  05.84%  |
7th: totallyhuman|1  answer  cracked| 13  bytes |   13 bytes  |  02.45%  |
8th: LdBeth      |1  answer  cracked| 11  bytes |   11 bytes  |  02.07%  |
                 +------------------+-----------+-------------+----------+
            Total|12 answers cracked| 530 bytes |
                 +------------------+-----------+
Largest cracks amount for 65.66% of the total number of bytes
cracked.

Smallest cracks amount for 53.96% of the total number of bytes
cracked, however there is some overlap with largest cracks
because of people only doing one crack (although that's fine).

There is an overlap between the smallest cracks and largest cracks
of 154 bytes, or 29.05%

Most answers cracked by language

1st: Mathematica        |5 answers cracked|202 bytes|38.11%|
2nd: C (gcc)            |2 answers cracked|133 bytes|25.09%|
3rd: Go                 |1 answer  cracked|69  bytes|13.01%|
3rd: Javascript (NodeJS)|1 answer  cracked|51  bytes|09.62%|
3rd: Python             |1 answer  cracked|50  bytes|09.43%|
3rd: Uiua               |1 answer  cracked|14  bytes|02.64%|
3rd: J                  |1 answer  cracked|11  bytes|02.07%|
\$\endgroup\$

12 Answers 12

4
\$\begingroup\$

JavaScript (Node.js), 51 bytes, cracks @l4m2

eval(unescape`%4d%61%74%68["a%74a%6e"+7%5%5%8%30]`)

Try it online!

\$\endgroup\$
4
\$\begingroup\$

Wolfram Language (Mathematica), 13 bytes, cracks Greg Martin

Re@*N@*ArcTan

Try it online!

Prints more than six significant figures on TIO, possibly because of the Print function or just... I dunno. :P

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Well done! Yeah, the number of digits displayed is different in the application's environment than in a console version. \$\endgroup\$ Commented Mar 16 at 16:57
4
\$\begingroup\$

Wolfram Language (Mathematica), 48 bytes, cracks att

N[ToPolarCoordinates[List[##,##]][[Abs[2]2]]]&

Try it online!

All credit goes to Greg Martin for actually finding the initial solution.

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

Uiua 0.10.0, 14 bytes, cracks @Tbw

⍥¬0(÷×.±↥⊃∩⌵∠)

Try on Uiua Pad!

\$\endgroup\$
4
  • 2
    \$\begingroup\$ This answer does not produce the same outputs as my code. If it helps, my code more closely matches the example cases (one of them in particular). \$\endgroup\$
    – Tbw
    Commented Mar 16 at 15:22
  • 1
    \$\begingroup\$ @Tbw, Should be fixed now \$\endgroup\$ Commented Mar 16 at 16:32
  • \$\begingroup\$ This does match my answer's outputs, but is still somewhat different in structure. I don't know the rules for this, but if it is cracked, I will include my code as a spoiler in my answer. \$\endgroup\$
    – Tbw
    Commented Mar 16 at 23:52
  • \$\begingroup\$ @Tbw, at this point it is consider cracked; feel free to include your code as a spoiler in your answer. \$\endgroup\$ Commented Mar 17 at 2:58
2
\$\begingroup\$

Wolfram Language (Mathematica), 57 bytes, cracks CrSb0001

f[x_,y_]:=N[Arg[x+y*I]+(b-b)/6*FIILNR[e,e][][]*mmoorsuxy]

Try it online!

Be careful what you allow :)

\$\endgroup\$
1
  • \$\begingroup\$ To be fair, that was not what was intended lol. I'll edit my ans. with my intended sol. \$\endgroup\$
    – CrSb0001
    Commented Mar 18 at 19:46
2
\$\begingroup\$

Wolfram Language (Mathematica), 53 bytes, cracks Greg Martin

Im@Integrate[1/e,{e,1.,#+#2I+Boole[#<0&&#2==0]/9!I}]&

Try it online!

I couldn't figure out what the 9 was doing there until I reread the question...

\$\endgroup\$
1
  • \$\begingroup\$ Great job! I thought about making it a bit more obscure by changing Integrate[1/e,{e,1.,... to Integrate[1/Null,{,1.,.... But I figured if someone figures out the Integrate paradigm they should get the win :D \$\endgroup\$ Commented Mar 20 at 7:11
2
\$\begingroup\$

Python, 50 bytes, cracks @CursorCoercer

lambda e,f:log(e+(1.0j*f)).imag
from cmath import*

Attempt This Online!

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

J, 11 bytes, cracks Bubbler

_&,^:_1.&*. or _&,^:_1&.*. or _.&,^:_1&*.

The only thing that could be relevant to complex angle in the puzzle is *., that decomposes complex number into length and angle, then the presence of ^ and : implies it is likely ^:_1 has been used, and associate that with the presence of , and _ which the later can only be used to indicate a number "plus infinity", it would be apparent that _&,^:_1 is used to take the second result returned by monadic *..

However, after formulated _&,^:_1&*., there is still one . left, interesting enough, this . can be combined with _ or _1, both accepted as valid literals by J (_. is NaN, _1. is also negative one but in float format) or forms under &., that utilizes the fact the inverse of *. on a real number is the identity function, results in three different valid answers.

\$\endgroup\$
1
  • \$\begingroup\$ The intended solution was the one that uses &.. \$\endgroup\$
    – Bubbler
    Commented Apr 1 at 7:07
1
\$\begingroup\$

Go, 69 bytes, cracks @bigyihsuan

import."math/cmplx";func Posswf(n complex128)float64{return Phase(n)}

Try it online!

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

Wolfram Language (Mathematica), 31 bytes, cracks CrSb0001

NumberForm[Im[Log[N[x+I*y]]],6]

Try it online! (I don't know why but TIO doesn't reduce NumberForm[...,6] like Mathematica does)

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

C (gcc), 65 bytes, cracks Blue

#include <math.h>,x
float h(float y, float s){return atan2(y,s);}

the elevation of ,x was quite a surprise

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

C (gcc), 68 bytes, cracks? Blue

#include <complex.h>
float h(float n, float at){return carg(n+at*I);}

-- Am I right to believe that for imaginary reasons, a space character transformed into a semi-colon?

\$\endgroup\$

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