Golfing Chain (Robbers' Thread)

8

This is a Cops and Robbers challenge. For the Cops' thread, go here.

The Cops have three tasks.
1) Pick a sequence from the OEIS.

2) Pick a language (this is suggested to be a golflang, but doesn't have to be) that, when given input n, outputs A(n) (where A(n) is the sequence chosen) using all usual rules.
Call this language LA and code CA.
For example, Jelly and Jelly_code.

3) Then, pick a different language (this is suggested to be a non-golflang, but doesn't have to be) and write code that takes no input and outputs code CA, again following all usual rules. (Note: this can be obfuscated code and doesn't necessarily need to be golfed, but the longer this code is the easier it will be for the robbers to crack your submission.)
Call this language LB and code CB.
For example, Python and Python_code.

The Cop's submission to this challenge is the sequence (specified whether 0- or 1-indexed), the name of the two languages LA and LB (and which one solves which part), and the byte-count of CB only. Keep the actual code of both parts, and the length of CA, secret.

The Robber's challenge is to select a Cops' entry and write code CC in the same LB language that outputs some code in the same LA language that solves the original OEIS task. The length of CC can be no longer than the length of CB as revealed by the cop (though may be shorter). Note: The code produced by CC does not have to match CA.

For our example, this means that the Robber has to write Python code that outputs Jelly code that solves the original OEIS sequence, and that Python code has to be no longer than the length revealed by the Cop.

Winning conditions

The Robber with the most cracked solutions wins.

AdmBorkBork

Posted 2018-06-06T15:22:11.587

Reputation: 41 581

Answers

6

Brain-Flak, 90 bytes by Mr. Xcoder

((((((((((()()()){}){}){({}[()])}{}())[(((()()()){})){}{}()]))){}{}()()())([][][]){})[][])

Try it online!

This outputs:

ÑÉ·<O

First 05AB1E answer!

How does it work?

Let's say we have 24 as input.

Ñ       # Divisors. 
        # Stack: [1, 2, 3, 4, 6, 8, 12, 24]
 É      # Odd?
        # Stack: [1, 0, 1, 0, 0, 0, 0, 0]
  ·     # Double
        # Stack: [2, 0, 2, 0, 0, 0, 0, 0]
   <    # Decrement
        # Stack: [1, -1, 1, -1, -1, -1, -1, -1]
    O   # Sum
        # Stack: -4

The brain-flak code mostly just uses tricks to push large numbers in few bytes. It was very convenient (and unintentional) that the ASCII values are mostly increasing:

209
201
183
60
79

It's also nice that 60 * 3 ~=~ 183 so tripling it and adding a few can save a ton of bytes.

((((((

    # Push 79
    ((((()()()){}){}){({}[()])}{}())
    # Minus 19 (60)

    [(((()()()){})){}{}()])
    # Push that two extra times
    ))

    # Push that ^ (60) Plus the two extras popped (60 + 120 == 180)...
    {}{}
    # + 3 (183)
    ()()())

    # Plus stack-height * 3 * 2 == 3 * 3 * 2 == 18 (201)
    ([][][]){})

    # Plus stack-height * 2 == 4 * 2 == 8 (209)
    [][])

James

Posted 2018-06-06T15:22:11.587

Reputation: 54 537

oh nice my 05AB1E program was 8 bytes. idk any of the 05AB1E builtins /shrug :P – HyperNeutrino – 2018-06-06T17:59:27.800

Here's 80 – Post Rock Garf Hunter – 2018-06-21T03:30:06.543

Here's 72 – Post Rock Garf Hunter – 2018-06-21T03:40:23.693

2

Jelly, 34 bytes by Arnauld

Managed a byte shorter than his solution!

“`Ḃ|⁴ʂⱮdÐỌK_ƬƬfıæh’ṃ“fnk1()+-,=>?:

Try it online!

This outputs the JS function

f=(n,k=1)=>n>=k?f(n-k,k)+f(n,k+1):1>n

which computes A000041 (0-indexed; nn(0) returns true in place of 1).

ETHproductions

Posted 2018-06-06T15:22:11.587

Reputation: 47 880

2

TeX by Simon Klaver

g\bye

prints g, which computes the length of the input in 05AB1E.

Lynn

Posted 2018-06-06T15:22:11.587

Reputation: 55 648

2

Malbolge, 32 bytes by Lynn

('%$:?>7[5|981Uv.uQrq)Mnmm$Hj4ED

Try it online!

That prints the following haskell function:

gcd 2

Try it online!

I used this online tool to generate the Malbolge

H.PWiz

Posted 2018-06-06T15:22:11.587

Reputation: 10 962

I used the same tool :) I was hoping not many people know about it. – Lynn – 2018-06-17T17:59:28.013

1

betseg

Posted 2018-06-06T15:22:11.587

Reputation: 8 493

1

Triangularity by Mr. Xcoder, 36 bytes

... ...
..  "..
.aẒ;Ba.
1ÇP$#Ṁ"

Try it online!

Prints Jelly code:

..
.aẒ;Ba.
1ÇP$#Ṁ

Try the Jelly code online! It's quite slow.

Lynn

Posted 2018-06-06T15:22:11.587

Reputation: 55 648

Most definitely not what I was thinking of but congrats! I'll include the intended solution in my answer shortly. – Mr. Xcoder – 2018-06-17T16:27:52.290