10
\$\begingroup\$

This is the robbers' thread. For the main rules to this challenge see the cops' thread

In this challenge, robbers will choose a cop's vulnerable or safe post and try to figure out a pair of languages such that they print the correct results for the 4 programs.

When you find a solution post an answer of it here and leave a comment on the original post linking to your answer.

Scoring

Robbers will be given 1 point for every vulnerable or safe they solve. The goal of the robbers' thread is to gain as many points as possible.

Languages and Output

In the interest of fairness, we are going to require that languages are free and reasonably cross platform. Both languages you choose must be freely available on Linux and FreeBSD (the two largest foss operating systems). This includes languages which are free and open source.

Your selected languages must predate this challenge.

Since this challenge requires that A and B produce different outputs for the same program, there is no requirement for what "counts" as a different language, the fact that they produce different outputs is enough.

Programs do not have to compile, run without error or "work" in the cases where they do not need to output S. As long as S is not the output it is valid.

Programs here should be complete programs, not functions, expressions or snippets.

\$\endgroup\$

9 Answers 9

6
\$\begingroup\$

A = Haskell, B = Ruby, AZTECCO

  1. Try it online in Haskell and Ruby.
  2. Try it online in Haskell and Ruby.
  3. Try it online in Haskell and Ruby.
  4. Try it online in Haskell and Ruby.

This would also work with A = Curry (PAKCS).

\$\endgroup\$
5
\$\begingroup\$

A = Hexagony, B = Labyrinth, Bubbler

  1. Both Hexagony and Labyrinth
"123_1234!@

Try it online in Hexagony and Labyrinth

  1. Only Hexagony
123+1
234!@

Try it online in Hexagony and Labyrinth

  1. Only Labyrinth
1234@
;!;!;

Try it online in Hexagony and Labyrinth

  1. Neither Hexagony nor Labyrinth
;!;!;
1234@

Try it online in Hexagony and Labyrinth

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

A = HQ9+, B = Python 3, thejonymaster

Not sure if this was the intended solution but it works!

Also, it seems that some implementations of HQ9+ are case insensitive which invalidates this crack, but I am specifically using the HQ9+ implementation on DSO, which is case sensitive.

  1. Both HQ9+ and Python 3 work
#console.log("Hello, world!")/*
print("hello, world!".capitalize())
#*/

Try It Online in Python 3 and HQ9+

  1. Only HQ9+ works
console.log("Hello, world!")/*
print("hello, world!")
*/

Try It Online in Python 3 and HQ9+

  1. Only Python 3 works
#console.log("Hello, world!")/*
print("Hello, world!")
#*/

Try It Online in Python 3 and HQ9+

  1. HQ9+ and Python 3 both don't work
console.log(String.fromCharCode(49-1)+"ello, world!")/*
print(String.fromCharCode(49-1)+"ello, world!")
*/

Try It Online in Python 3 and HQ9+

\$\endgroup\$
4
  • \$\begingroup\$ Smart. I was looking for a cursed combination of JS and Python. (btw this works with Ruby) \$\endgroup\$
    – emanresu A
    Commented Aug 31, 2022 at 1:26
  • \$\begingroup\$ @emanresuA that was the joke :P edit: ooh ruby i gotta be more careful \$\endgroup\$ Commented Aug 31, 2022 at 1:38
  • \$\begingroup\$ Correct interpreter even! this was mainly a joke, thank you for playing \$\endgroup\$ Commented Aug 31, 2022 at 1:38
  • \$\begingroup\$ it works with Crystal as well. \$\endgroup\$
    – naffetS
    Commented Aug 31, 2022 at 1:46
2
\$\begingroup\$

A = Python, B = PARI/GP, alephalpha

  1. Try it online in Python and PARI/GP.

  2. Try it online in Python and PARI/GP.

  3. Try it online in Python and PARI/GP.

  4. Try it online in Python and PARI/GP.

Instead of Python, it could be Ruby, Perl, Raku, or a zillion other languages.

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

A = Python 2.7, B = SunSip, Number Basher

Only STDOUT is considered output, all programs liberally print garbage to standard error.

  1. Both SunSip and Python2.7
print('0')
out

Try it online in Python 2 and SunSip

  1. Only Python2.7
print('0')
out#

The # stops the parsing of the keyword so it doesn't work.

  1. Only SunSip
print('0',)
out #

Try it online in Python 2.7 and SunSip

Outputs ('0',) in python

  1. Neither SunSip not Python 2.7

Obviously does nothing in either program.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Dang I had pretty much the same thing, except I couldn't get the Sunsip interpreter to work for some reason (was trying to get TIO links for Sunsip). \$\endgroup\$
    – Aiden Chow
    Commented Aug 31, 2022 at 7:56
  • \$\begingroup\$ Yea I couldn't get the online interpreter to work either, had to download it \$\endgroup\$ Commented Aug 31, 2022 at 7:58
  • 1
    \$\begingroup\$ It looks like it only takes programs from text files, that's why it doesn't work on TIO. I edited the source code to take in the program directly as an argument, not sure if that's allowed though. \$\endgroup\$
    – Aiden Chow
    Commented Aug 31, 2022 at 8:06
  • \$\begingroup\$ @AidenChow Probably fine if you are just changing the input method, but you need to be careful not to accidentally create a version of the language from after the challenge was posted \$\endgroup\$ Commented Aug 31, 2022 at 8:10
  • \$\begingroup\$ Also the code for the first block should be out in the second line, not end. \$\endgroup\$
    – Aiden Chow
    Commented Aug 31, 2022 at 8:10
2
\$\begingroup\$

A = ><>, B = Adapt, mousetail

Although this outputs a trailing newline for B, mousetail has clarified this is acceptable.

  1. 2 in ><>, 2 in Adapt
  2. 2 in ><>, [] in Adapt
  3. no output & errors in ><>, 2 in Adapt
  4. 1 in ><>, 1 in Adapt
\$\endgroup\$
3
  • \$\begingroup\$ Not what I intended but still good find \$\endgroup\$ Commented Sep 1, 2022 at 6:11
  • \$\begingroup\$ Seems like it prints 2 with a newline in Adapt, which does not match the original string (which is 2 by itself, no newline). \$\endgroup\$
    – Aiden Chow
    Commented Sep 1, 2022 at 23:54
  • \$\begingroup\$ @AidenChow I'll get back to it then. Deleting until I figure it out truly. \$\endgroup\$ Commented Sep 2, 2022 at 0:37
1
\$\begingroup\$

Vyxal and Jelly, cracks Number Basher's answer

  1. empty program, Vyxal, Jelly
  2. !, Vyxal, Jelly
  3. r, Vyxal, Jelly
  4. ", Vyxal, Jelly
\$\endgroup\$
1
\$\begingroup\$

A = Pyth, B = V (vim), Mukundan314

  1. Try it online in Pyth and V.
  2. Try it online in Pyth and V.
  3. Try it online in Pyth and V.
  4. Try it online in Pyth and V.
\$\endgroup\$
1
\$\begingroup\$

0SAB1LE and yup, Kevin Cruijssen

  1. 0SAB1LE, yup
  2. 0SAB1LE, yup
  3. 0SAB1LE, yup
  4. 0SAB1LE, yup

I just went through everything on TIO that looked like a stack based language until I found one that worked.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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