12
\$\begingroup\$

This is the robbers' thread to a challenge. Click the link to find the cops' thread.

In the cops' thread of this challenge, answerers will be writing programs which output two numbers, \$x\$ and \$y\$. As robbers, your goal will be to crack their submissions. To do this, you find a program in the same language as a cop's program which outputs a number in between \$x\$ and \$y\$, and is the same length as or shorter than the cop's program. Your program must use the same output method as the cop's submission.

You submit that program here and notify the cop in a comment on their answer.

For every answer you crack here you get 5 points. As an extra incentive you will gain an additional point for every byte shorter your program is than the cop's. If your program is the same length, that is fine; you still get 5 points.

The winner is the person with the highest total score across all answers.

\$\endgroup\$

11 Answers 11

15
\$\begingroup\$

Malbolge, 6 bytes, cracks Kamila Szewczyk's answer

(&<`q#

Try it online! (or try it here to avoid timing-out)

Outputs 2.

Explanation.
The goal is to output the ASCII character "2" in a 7-byte or less program.

Malbolge code & data occupies the same memory space. When a Malbolge program is loaded, the last two single-byte instructions act as 'seeds' that determine how the remaining memory is initialized (in a deterministic but rather uncontrollable fashion). So if we try to construct 5 command/byte programs that use the contents of the memory to generate the ASCII encoding for "2", we can try different combinations of the remaining 2 commands/bytes to try to find one that gives the correctly-initialized memory to achieve this. There are 8 valid Malbolge commands (and any other byte in the program will generate an error upon loading), so this gives us 8x8 combinations to try per 5 byte program. This is obviously less than the 1/256 chance of 'hitting' the ASCII character "2" in any particular byte, so we'll probably have to try more than one program.

Each Malbolge command self-modifies immediately after execution, making re-use rather difficult. So here we try only single-pass programs, without any attempt to loop. We will need to use the commands j (set the data pointer), < (write an ASCII value to the output), and (probably) v (end the program). This gives us room for 2 more data-altering commands in within the 5-byte limit, so we can try combinations of * (rotate) and p (tritwise OP operation), as well o (no operation; but in Malbolge this changes the data pointer as a side effect so it can also affect the output).

Unfortunately, after trying all 64 combinations of the final two bytes across the Malbolge programs jpo<v.., jop<v.., ojp<v.., jpp<v.., jppp<v., jpppp<v, j*o<v.., j*p<v.., j*pp<v. and j*ppp<v (where . represents any of the 8 Malbolge commands), we can only generate the output numbers 0, 1, 3, 5, 6, 7, 8, 9. At this point it seems likely that Kamila Szewczyk may have used a similar approach, and therefore hoped that generating the character "2" in 7 bytes or less is impossible...

But: what about shorter programs that omit the v (end the program) command? These allow the memory to be initialized differently, and so we can maybe find a combination that enables output of "2"... but the Malbolge interpreter will now continue reading bytes from the rest of the initialized memory and executing them as commands, with rather uncontrollable consequences! Still, if it hits a v (end of program) before it hits a < (write output), that could be Ok: so let's try it!

After some searching, we find that j*p<.. is indeed able to initialize the memory to output "2", using two different suffix combinations: when test-run, <j unfortunately keeps running and outputs an additional "2L" before stopping, but /j stops after the "2". It's a crack!

To load into Malbolge, the final program - j*p</j - must finally be encoded using a series of operations (see the spec) to yield the final loadable code of (&<`q#.

\$\endgroup\$
9
\$\begingroup\$

R, 4 bytes

2e98

Try it online!

Not much fun but the range makes it cracked

\$\endgroup\$
9
\$\begingroup\$

Vyxal, 26 18 14 bytes (88 bytes saved)

Crack of @lyxal's vyxal cop program

k×:\(+33*\↵+Ė›

Try it Online!

output lowest bound +1

(first time doing vyxal, tell me if I did something incorrectly)

Explanation

k×         Push 2147483648 onto the stack
           => [2147483648]
:          Duplicate the stack
             => [2147483648, 2147483648]
\(+        Concatenate the last element of the stack with `(`
             => [2147483648, '2147483648(']
33*        Multiply by 33 the string on top of the stack
             => [2147483648, '2147483648(21 ... 8(2147483648(']
\↵+        Add `↵` to the string on top of the stack
             => [2147483648, '2147483648(21 ... 8(2147483648(↵']
Ė          Evaluate as vyxal code the last element of the stack (see the cop thread)
             => [ <lowest bound> ]
›          Add 1 to the result
             => [ <lowest bound +1> ]
           implicit output
\$\endgroup\$
3
  • \$\begingroup\$ :`( are you sad? \$\endgroup\$
    – Fmbalbuena
    Jan 31 at 14:27
  • \$\begingroup\$ C+: no I'm happy \$\endgroup\$
    – Jakque
    Jan 31 at 16:26
  • \$\begingroup\$ rip the old version of the code where these ^ jokes ^ made sense T_T \$\endgroup\$ Feb 1 at 0:32
8
\$\begingroup\$

Brachylog, 5 bytes (0 bytes saved), 20922789888

16ḟ↔↔

Outputs \$20\text{,}922\text{,}789\text{,}888\$.

Cracks @Fatalize's Brachylog Cop answer, which is also 5 bytes and the range \$14\text{,}159\text{,}265\text{,}359\$ to \$61\text{,}803\text{,}398\text{,}875\$.

Try it online.

Explanation:

16ḟ    # Push the factorial of 16: 20922789888000
   ↔   # Reverse (but remain an integer): 88898722902
    ↔  # Reverse back: 20922789888
\$\endgroup\$
1
  • 2
    \$\begingroup\$ Clever use of reverse on integers! \$\endgroup\$
    – Fatalize
    Jan 31 at 21:41
6
\$\begingroup\$

Excel, 6 bytes, cracks Luke Dunn's answer

=1E250

Try it online!

enter image description here

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

JavaScript (Node.js), 22 bytes

x=>'9'.repeat(1e7-1)-1

Try it online!

This cracks l4m2's cop.

Works only in theory. The string in the answer, with 9999999 golfed to 1e7-1, minus 1, which coerces it to a number.


JavaScript (Node.js), 22 bytes

x=>'909'.repeat(1e7/3)

Try it online!

Works in reality.

This one exploits the fact that the repetition count is rounded down.

\$\endgroup\$
1
  • \$\begingroup\$ Intended solution x=>'9'.repeat(1e7-2)+1 \$\endgroup\$
    – l4m2
    Jan 31 at 17:20
3
\$\begingroup\$

brainfuck, 15 bytes (10 bytes saved), cracks mathcat's answer

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

Try it online!

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

Octave, 6 bytes, cracks robbie crockett's first answer

28^213

Try it online!

Found by a brute force search of n where log(1.7e308,n) is very close but less than an integer so that n^ceiling(log(1.7e308,n)) is not too large.

\$\endgroup\$
1
  • \$\begingroup\$ I updated it. Good luck with the new one \$\endgroup\$ Feb 3 at 19:08
1
\$\begingroup\$

Seed, 4695 bytes (96 byte save), \$9^{999999999999999}\$

48 136118222288577729572552152791709368605773628347021471008690822115373392141244799774415998107055377981742447271161172093778621602759645881735548840779482802560209189517746243033627985739511100518293138471484155429274889918272710559291982273929396912514475806069037521031407489333870378703173662910402083164029699758795021006600087782123480276870349030965867563726975877728510764214971834340717031826050329624446895168002822671009104546726772407954859794475567312583905626817398451742396403319735329821368897163429801670218889821848435198982270769585133239840182076928600225425386926305906233725574337009104530356853863448383654832344408718772724757372631143287400290703116853900133240035664821661976772888810467002790969870927064001031662898740474966711631710727286951427698675681491111582579107155062882709864229052873760966169264245600186093538370974908907020474070930611562816292100183878427364763405389786799631792649382212389347264227332059441821014321577413408905755610100524739302573178913805937883513832378054230283344383753275902621779919104894612137194747465109053363132937703205299899090062685892622098070989799300096851455096301228710972701865038051936551041342440525433281771038877777161882636844059426594521805350407152290165733138028576146967247522643744694141195004623423857857693427850032738203686267421228588828435013088446245077772203162760491431357812801871298876631302950079959010177847566668826266369346040779302669462790393198104623019338124802383380441313038602352462845958086644089497490467594136351122837597449672487010313897868432189301305885675861325709179122431375903938149903427353406026693988298068066087414204535567217531278847246663063521026232422013930241593518848232749733716027932971967899916260405600669083231342566885341691912368360136490149146410247155251733391927312938665018633466748949229241307444214633067906713336048685943513134140263372359696945716406670478168007378272916725550905826132341140883161990841937113616809856754859509173906225877693272986499970529936397933788880924831441272134709649991804869975215537765013304261103280798035738449283801074367455416975896866833656686794976325679828000354046625307811860168996790355272279436375392093313679100121487235860221918848736347751782535229777178218227648706506003129525970134666691479694925217524902959803338422438060038658440582225592904612537669959087757488373578611752282868269275950214371229748731729215641332246654869362216109284862185496124584262579953474203167872603070470067950478753207808608248943878860011908115468802190546000519840247324568161439611525769820989196058123147718137077000120913662868599382356603269721601449988482683980532792892177658333875496383645485133701798213530386049902190319666619680418627484562095523349838908554879800729189834397636333150687591784783593636695475815080002634570530677847790228554244311329470586241698758265462755938042304017099033993858637076639260904636077951244351657896256391998258900387543477862789459882688297086948688007197707992577339183010173354065933555655553421866069534486864447491231024219783356908661520568506172333653043056654975852125377780460189002009695349728259441892176823884813139372756407875800289098734167129099381792737264454097003678873187452677901588877289663613161551851497712147029113595405001612731177702538079055158748598170770058186080901509151495332123511968083584199679029073876741472874261160159173180904406481520378171876773781817052362670957754076341052151226864982044423001068087857032658832611786035188675526138932008287577260700322890640413383485742814765880396419208969263227721270455088178847430617675460588467868983618120954389404362140231158416321704501412371098629111850576048849097883084678663620297477847964712187292115607313892012356396662805274189107494467684644891521782414262128173708455480707454354968100553678330533006106890027275388315886464487511584246560889155661821779830187538375406868333151665726444207031130208083500148213129337075506341798868095841311106337887887291979827246042278337117981115263174824668396544795084846659779500193321324649508077325582071348037416574693493790019348532848623137704882189995492207319495341511822520469501170794388924439459462165936478786200751196030621197856797511117488998623310034898658778486649937046992404397946797175451641601275425983240032855623615931663152448038884938302103599522781131691794955910668601656339114328483085213740867710698818388423094906297631419655436847220572682142406966844544894284269328182913703189411753835932978396033829515305455631318696053728968876051410783596705077112312728424202529475578776676152981258884551184505959739004252170359641105692336889964755135425463797747654176970663980003607348930037794652574271713970

Nothing clever on my part I stole this from the answer's edit history.

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

Python 3, 19 16 bytes (saves 22 25 bytes)

print(3*10**456570)

Cracks DialFrost's cop answer... I just did a bunch of trial and error to get this lol.

Try it online. Verify it's between the two numbers

\$\endgroup\$
1
  • \$\begingroup\$ 9**478462 saves 3 more bytes. (It should be a way to do x**x**x to save even more bytes but I don't have the patience to find it \$\endgroup\$
    – Jakque
    Feb 2 at 16:35
1
\$\begingroup\$

!@#$%^&*()_+, 6 bytes, cracks Fmbalbuena's answer

~(#)

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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