Overlapping Polyglots

37

4

Unlike many C&R challenges, this does not require a separate robbers post; the goal of the robbers is to crack the previous answer and then post a new one as a cop.

As answerers, you will write a series of polyglots that look like this (each column is a language, and each entry is the output of the answer in that language):

Language:  1  2  3  4  5  6  7  8  ...
Answer 1:  0  1  2
Answer 2:     1  2  3
Answer 3:        2  3  4
Answer 4:           3  4  5
Answer 5:              4  5  6
Answer 6:                 5  6  7
...

(blank spaces mean that no behavior is required in that case).

Each answer should work in 3 languages and print 3 different consecutive numbers which are each one more than the numbers printed by the previous answer (the first answer prints 0, 1, and 2). Each answer uses two languages from the previous submission, and a third new language. The answerer should try to obfuscate what this third language is.

To post a new answer, you should:

  • Crack the most recent answer by finding what its third language is.
  • Preferably, add an explanation for your crack and notify the poster of the answer. Once your submission has been cracked, you should preferably add an explanation as well.
  • Write a polyglot consisting of this answer's second and third languages, along with another language of your choice. Reveal your first two languages, but do not reveal your new one. It will be the next poster's goal to find this language (or any other language in which it works), so you should try to obfuscate it.

Specifications

  • The criteria for a valid programming language are the same as those of The Programming Language Quiz, Mark II - Cops:

  • Each answer must run in less than a minute on a reasonable PC.

  • You can reuse programming languages, but there must be at least two answers in between (so an individual answer cannot reuse a language).
  • Cracking a submission consists of finding any programming language that prints the correct result, not just the intended one. If a submission is run in any language that was not declared or found to work, there are no requirements to do anything.
  • You may not post twice (or more) in a row.

Winning Criterion

The winning answer is whichever answer took to most time to be cracked. The challenge will never end, so it is always possible for the winning answer to change.

Esolanging Fruit

Posted 2018-09-09T05:22:46.200

Reputation: 13 542

Sandbox. – Esolanging Fruit – 2018-09-09T05:29:38.097

2

Opened a chatroom for discussion about possible cracks and building polyglots.

– Bubbler – 2018-09-10T23:35:13.680

1Can the answer output other things apart from the desired number? – NieDzejkob – 2018-09-30T09:21:26.687

Must the answer run in a specific amount of time? – NieDzejkob – 2018-10-11T17:30:59.033

1@NieDzejkob No, the program should only output the number, and yes, I'd prefer if the programs ran in under a minute. – Esolanging Fruit – 2018-10-13T10:59:27.673

@EsolangingFruit What about leading and trailing whitespace? In particular, what about a since trailing newline? – NieDzejkob – 2018-10-13T13:13:00.110

3

Here's a SEDE query that calculates the amount of time the answers stayed safe (in hours).

– NieDzejkob – 2018-10-15T20:50:57.183

@NieDzejkob Thanks! I was considering creating something like that but I'm no good with SEDE. – Esolanging Fruit – 2018-10-20T07:09:14.877

Can we require that a program must be run with a particular command-line option or compiler flag or argument? – Embodiment of Ignorance – 2019-02-17T06:20:01.217

Also, does the output have to only contain the number and nothing else, and can the output to be stdout? – Embodiment of Ignorance – 2019-02-17T06:35:02.593

1@EmbodimentofIgnorance Yes, you can require command-line flags as they essentially define separate interpreters, and yes, the program must print only the number. The program may output to STDERR, but only the output to STDOUT is relevant. – Esolanging Fruit – 2019-02-17T08:53:04.910

Answers

11

Hexagony, Klein (101) and ???

  xx={puts/}
gets87!@xx=p

main\

>9.*5,6v

This prints 7 in Hexagony, 8 in Klein (101), and 9 in ???.

The 9 does not work if a newline is added at the end of the code. Be careful if you're testing locally.

Edit: Being live for 20 hours is already a record, so I'll give some hints from now on. (Also because the language in question is IMO not yet well-known.)

Hints

  1. "The 9 does not work if a newline is added at the end" is very significant, as well as the first two spaces (which are ignored by both Hexagony and Klein).
  2. The language is on TIO.
  3. The first two spaces make the program jump to the last line. (It's not a 2D language.)
  4. There's no explicit output command, and the v command ends the program.

Explanation (cracked post)

In the source code

abcd={} -- a gaffe avoiding tactic in C++/C#
abcd[!1]=   1+2+3+4+5+6+7+8+9+10+11+12+13+17!
print(abcd[0>1+2+3 and 4+8+6<0-0]//35)
if 0>1 then a.next=';' en\
                    >1+6.@.@

The relevant instructions in Klein (101) are:

IP->.....................^...........IP->/
.........................|...................
.........................8
.........................\<-.............IP<-
                         @

Klein is fungelike 2D language where crossing the boundary of code area (which is a square) depends on the Klein topology. / and \ are mirrors.

The IP starts at upper left corner facing right. It meets a mirror towards the top boundary, and re-enters the code area on the right side as shown above. Then it hits the mirror again, 8 is pushed, and then (after passing through the boundary several times) stops at @. Then the content of the stack is printed to stdout, which is single 8.

Bubbler

Posted 2018-09-09T05:22:46.200

Reputation: 16 616

1cracked – NieDzejkob – 2018-09-11T17:19:22.223

9

Befunge-96, Hexagony and ???

abcd={} -- a gaffe avoiding tactic in C++/C#
abcd[!1]=   1+2+3+4+5+6+7+8+9+10+11+12+13+17!
print(abcd[0>1+2+3 and 4+8+6<0-0]//35)
if 0>1 then a.next=';' en\
                    >1+6.@.@

This prints 6 in Befunge-96, 7 in hexagony and 8 in ???.

Explanation

The hexagony code, when "prettified" is:

       a b c d = { } - 
      - a g a f f e a v 
     o i d i n g t a c t 
    i c i n C + + a b c d 
   [ f a l s e ] = 1 + 2 + 
  3 + 4 + 5 + 6 + 7 + 8 + 9 
 + 1 0 + 1 1 + 1 2 + 1 3 + 1 
7 ! p r i n t ( a b c d [ 0 > 
 1 + 2 + 3 a n d 4 + 5 + 6 < 
  0 - 0 ] / / 3 5 ) i f 0 > 
   1 t h e n a . n e x t = 
    ' ; ' e n d > 1 + 6 . 
     @ . . . . . . . . . 
      . . . . . . . . . 
       . . . . . . . . 

The path of execution begins in the top left heading East. The top row doesn't do much. - changes the current memory edge so the value in it is 0. Execution continues heading east on the middle row where 7! loads 7 in the current memory edge and prints is as an integer. [ changes the instruction pointer to North East starting back at 7. After 7+3, execution then reaches [ which changes the instruction pointer to North West starting in the South East corner. Finally the path is ..@ where @ terminates the program.

jslip

Posted 2018-09-09T05:22:46.200

Reputation: 721

1Cracked. – Bubbler – 2018-09-10T04:22:09.617

8

Lua, brainfuck, ???

abcd={} -- a gaffe avoiding tactic in C++
abcd[false]=1+2+3+4+5+6+7+8+9+10+11+12+13+14
print(abcd[0>1+2+3 and 4+5+6<0-0]//35)
if 0>1 then a.next=';' end

Prints 3 in Lua, 4 in brainfuck and 5 in ???.

Explanation for cracked post:

a=1+2+3+3+4+5+6+7+8+9
b=1+1+1
f=3--(-1)
c=7+9+13+11+12+3--1
g=a+b+c+1+2+3+4+5
j=9+7+g+c+b+a+g+g+g+g+g+g+1+2+3+4+1+1
h=1+1+1+1+333+1+1+1+111+1+1+1+333+1+1+1+1+1.
print(f)
  • In Python 3, 3--(-1) is 2, so print(f) prints 2 (the other stuff is unnecessary)
  • In Lua, -- again is a comment, so 3--(-1) is just 3, so print(f) prints 3 (other stuff is again unnecessary)
  • In brainfuck, there are 57 plusses and 5 minuses setting the first cell on the tape to 52, and the . outputs character 52 which is 4.

boboquack

Posted 2018-09-09T05:22:46.200

Reputation: 2 017

+1 and Cracked

– Zacharý – 2018-09-09T11:50:59.157

8

Trigger, JavaScript and ???

[ //aТ/\\ ][ //е"6
console.log(111-111+12)]
//!'!/-²6-²52

Prints 11 in Trigger, 12 in JavaScript, and 13 in REDACTED.

Since this has not been cracked for longer than any other answer so far, here are some hints:

  • In case you didn't notice, the Т and е on the first line are multibyte characters.
  • [ // and \\ ][ // are no-ops.
  • The second line, as well as -²52, is dead code.
  • The language does not have a concept of termination, so ²6 forms an infinite loop.
  • To be specific, the second byte of the UTF-8 encoding of ², together with the 6, forms an infinite loop.
  • The number being outputted is encoded by the /!'!/
  • The language is not on Try It Online, Rosetta Code or Esolangs.
  • The only available form of output is a 1bpp screen.
  • The screen's aspect ratio is 2.
  • While the language was not originally intended as machine code, FPGA implementations do exist.
  • According to Wikipedia, the intended purpose of the language were video games.
  • The only way to access the screen is a special instruction, that takes coordinates in selectable registers, and the height as an immediate, and XORs an 8 by n bitmap onto the screen. To make collision detection easier, as well as make it possible to clear the screen, one of the registers will be set when any pixel gets set back to off.

Explanation

Well, this took some time to get cracked. Let's see how the code looks:

0200 5b20    SE VB, V2   ; Skip the next instruction if VB = V2. Since all
0202 2f2f    CALL 0xF2F  ; registers start at 0, this call will be skipped. This
                         ; hides the bytecode from JavaScript.
0204 61d0    LD V1, 0xD0 ; A useless load. Necessary to use a UTF-8 continuation
0206 a22f    LD I, 0x22F ; byte as an instruction and load the address of
                         ; the sprite.
0208 5c5c    SE VC, V5   ; A red herring supposed to suggest symmetry is
                         ; important, as well as a totally intended eliminator
                         ; of inaccurate implementations. Most documentation
                         ; claims that the lowest nibble must be zero, but in
                         ; the original COSMAC VIP implementation it's
                         ; a don't-care.

This means that, while many available emulators behave correctly, the by-the-rules implementation is linked to in the second sentence of the Wikipedia page. Of course, it can't be run directly on an average PC, but I've found the Emma 02 emulator linked to on the COSMAC VIP page to work the best.

020A 205d    CALL 0x05D    ; Skipped.
020C 5b20    SE VB, V2     ; Same as with the very beginning. Red herring.
020E 2f2f    CALL 0xF2F
0210 d0b5    DRW V0, VB, 5 ; Draw the sprite pointed to by I. Since V0 and VB
                           ; haven't been written to yet, the sprite will be drawn
                           ; in the top-left corner of the screen. The height is
                           ; an immediate.
0212 2236    CALL 0x236    ; Jump over the JavaScript and Trigger code. It doesn't
                           ; matter that we never return.
0214-022E *never used*
022F 2f      DB %00101111  ; Sprite data.
0230 21      DB %00100001
0231 27      DB %00100111
0232 21      DB %00100001
0233 2f      DB %00101111
0234-0235 *never used*
0236 b236    JP V0, 0x236  ; Since V0 is still zero, this is an infinite loop.
0238-023C *never used*     ; Together with the previous two lines, it's the
                           ; -²6-²52. It's a red herring supposed to suggest
                           ; prefix, or Polish, notation.

NieDzejkob

Posted 2018-09-09T05:22:46.200

Reputation: 4 630

Don't tell me this is machine code on some processor. – SIGSTACKFAULT – 2018-09-21T12:35:25.153

1@Blacksilver I've been assuming so since two hints ago - what else would look like this, not be on Esolang, but still be notable enough for Wikipedia? – Ørjan Johansen – 2018-09-21T18:31:29.900

@Blacksilver OK. – NieDzejkob – 2018-09-22T08:51:18.473

@ngm sorry, but no – NieDzejkob – 2018-09-23T09:23:28.617

cracked, I believe, according to the rules. – ngm – 2018-09-26T18:26:51.123

7

Python 2, Python 3, ???

a={1,2}
print(1+#a
--bool(1/2)
)

This prints 1 in Python 2, 2 in Python 3, and 3 in ???.

Crack explanation (Cracked post):

#define print(A) main(){puts("0");}
print(1+bool(1/2))
  • 0: C: The first line defines a function-like macro print that ignores its single argument and evaluates to main(){puts("0");}, a full program that prints 0 and exits. The whole expression 1+bool(1/2) is ignored when the print( ) macro on the second line is expanded to main(){puts("0");}.

  • 1: Python 2: The first line is a comment. 1/2 uses integer division in Python 2, giving 0. This value is then interpreted as a boolean (bool(0) -> False) and then added to 1 (1+False -> 1), and then printed.

  • 2: Python 3: The first line is a comment. 1/2 uses float division in Python 3, giving 0.5. This value is then interpreted as a boolean (bool(0.5) -> True) and then added to 1 (1+True -> 2), and then printed.

pizzapants184

Posted 2018-09-09T05:22:46.200

Reputation: 3 174

+1 and Cracked

– Zachary Cotton – 2018-09-09T06:57:57.837

7

JavaScript, CHIP-8, and ???

[ //aТ/\\ ][ //е"6
console.log(111-111+12)]
//!'!/-²6-²52@++++2345

12 in JavaScript, 13 in CHIP-8, and 14 in ???

I'm going to go out on a limb and call this one cracked, although I can't quite get it to work I'm sure of the language (which seems to be what the rules ask for.)

Here is an imperfect explanation of the cracked post

The code in hexadecimal "is" (I might be slightly off):

[ 0x5b, 0x20, 0x2f, 0x2f, 0x61, 0xD0, 0xA2, 0x2f, 0x5c, 
0x5c, 0x20, 0x5d, 0x5b, 0x20, 0x2f, 0x2f, 0xD0, 0xB5, 
0x22, 0x36, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 
0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x28, 0x31, 
0x31, 0x31, 0x2d, 0x31, 0x31, 0x31, 0x2b, 0x31, 
0x32, 0x29, 0x5d, 0x0a, 0x2f, 0x2f, 0x21, 0x27, 
0x21, 0x2f, 0x2d, 0xb2, 0x36, 0x2d, 0xb2, 0x35, 0x32 ]

You can go here, click "Binary Tools" and paste this into the byte array box. Click "Decompile".

The key elements of the code are: instructions to say where the "number" is, the sprite command that prints the number, the correct amount of junk here and there, and the following:

: label-0
    0x2F
    0x21
    0x27
    0x21
    0x2F

To see what this represents you can click "Sprite Editor" and paste these hexadecimals into the box underneath. You'll see the answer:

enter image description here

I'm pretty sure you can then put anything you like at the end and the CHIP-8 result will not change, hence the new entry.

I would be delighted if someone could get this fully working, rather than the "proof" of the answer I've given here.

ngm

Posted 2018-09-09T05:22:46.200

Reputation: 3 974

I'm gonna allow that. I'll edit in an explanation later today. Good job. – NieDzejkob – 2018-09-27T09:29:54.607

Cracked – Jo King – 2018-09-29T11:50:49.107

Also, your hexadecimal must be wrong since it does not decode as valid UTF-8... – NieDzejkob – 2018-09-29T19:56:17.473

5

C, Python 2, ???

#define print(A) main(){puts("0");}
print(1+bool(1/2))

This prints 0 in C, 1 in Python 2, and 2 in ???.

This will be extremely easy to crack for people who know Python, but I wanted a starting-off point for other answers. Subsequent answers should try to obfuscate the third language (I did not do this).

Esolanging Fruit

Posted 2018-09-09T05:22:46.200

Reputation: 13 542

Cracked. Great challenge btw! – pizzapants184 – 2018-09-09T06:20:52.917

5

Python 3, Lua, ???

a=1+2+3+3+4+5+6+7+8+9
b=1+1+1
f=3--(-1)
c=7+9+13+11+12+3--1
g=a+b+c+1+2+3+4+5
j=9+7+g+c+b+a+g+g+g+g+g+g+1+2+3+4+1+1
h=1+1+1+1+333+1+1+1+111+1+1+1+333+1+1+1+1+1.
print(f)

Prints 2 in Python 3, 3 in Lua and 4 in ???.

Explanation for cracked post:

a={1,2}
print(1+#a
--bool(1/2)
)
  • In Lua, -- is a comment. In Python 2 and 3, -- indicates double negative in arithmetic.
  • In Python 2 and 3, # is a comment. In Lua, # is the length operator.
  • In Python 2, 1/2 is floor division, so it evaluates to zero. In Python 3 this is not the case. Because both versions of Python evaluate 0 to False, bool(1/2) evaluates to False in Python 2 and True in Python 3. When used in arithmetic, False is cast to 0 and True is cast to 1.

Zachary Cotton

Posted 2018-09-09T05:22:46.200

Reputation: 679

Cracked – boboquack – 2018-09-09T07:59:39.140

5

><>, Befunge-96 and ???

abcd={} -- a gaffe avoiding tactic in C++
abcd[false]=1+2+3+4+5+6+7+8+9+10+11+12+13+17!
print(abcd[0>1+2+3 and 4+5+6<0-0]//35)
if 0>1 then a.next=';' end
                    >1+6.@

This prints 5 in ><>, 6 in Befunge-96 and 7 in ???.

I know the intended solution was Befunge-93, but I couldn't resist.

Explanation:

Befunge-96 follows the same path as ><>, but ignores unknown instructions, ending up adding one to the 5 and multiplying it by 9 to get 54, the ascii code for 6.

Jo King

Posted 2018-09-09T05:22:46.200

Reputation: 38 234

1cracked – jslip – 2018-09-09T13:10:59.343

5

Commentator, Beatnik, ???

// k... nak... naKaka pagpAbaGaBag
static answer: Option<&String> = None;
 
fn llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch(s: &String){
  answer = Some(s);
}
 
fn pneumonoultramicroscopicsilicovolcanoconiosis(){
  println!("{}", answer.unwrap());
}
 
fn main(){
  let s = String::from("17");
  let t = "Hi! I am a cat. AOOOWRRRWWW! Me need Whiskas! Noow! Mee hungry hast bekommen. Feedme! sudo !!. Sad... six cable hostage wire cable diediediediee #               */";
  llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch(&s);
  pneumonoultramicroscopicsilicovolcanoconiosis();
}

Outputs 15 in Commentator, 16 in Beatnik, and 17 in the hopefully one language you are supposed to find.

Okay, it's clue time:

  • The name of the language refers to a compound of two elements, both of which make up your body, but with wildly varying percentages (which way depending on whether you're a robot).
  • The language itself is on TIO, but the implementation isn't.
  • Oh come on.

NieDzejkob

Posted 2018-09-09T05:22:46.200

Reputation: 4 630

1Looks like Rust( fn main(), among other things), but it doesn't actually run in Rust (explicit lifetime required in the type of 's'), neither on TIO nor another interpreter I found. And I can't find any other language that uses fn as a function identifier. – Draco18s no longer trusts SE – 2018-10-14T18:34:35.537

Huh, even the hint looks like Rust, which is a compound of Fe and O. I can't think of anything else. Maybe different compiler versions? – Bubbler – 2018-10-18T23:35:39.917

1

I suspect this might be Rust compiled with mrustc, which is basically Rust without the borrow checker.

– Esolanging Fruit – 2018-10-20T05:23:48.130

@EsolangingFruit try it – NieDzejkob – 2018-10-29T20:57:30.590

Three months later, I finally got around to cracking this

– Esolanging Fruit – 2019-02-02T08:54:48.890

4

Brainfuck, ><>, and ???

abcd={} -- a gaffe avoiding tactic in C++
abcd[false]=1+2+3+4+5+6+7+8+9+10+11+12+13+14
print(abcd[0>1+2+3 and 4+5+6<0-0]//35)
if 0>1 then a.next=';' end
                    >1+9*,@

Prints 4 in Brainfuck, 5 in ><>, and 6 in ???

  • In brainfuck, nothing changes.
  • In ><>, v redirects the flow of the program downwards. The n is numeric output. ; ends execution.

Zacharý

Posted 2018-09-09T05:22:46.200

Reputation: 5 710

Cracked – Jo King – 2018-09-09T12:23:17.463

4

Klein (101), Z80Golf, ???

!!8@e6v+4>9 \
Almost everything you can find on the internet is true
~Albert Einstein
 ~HUMAN IMAGE MACROS

Prints 8 in Klein (101), 9 in Z80Golf, and 10 in ???.

NieDzejkob

Posted 2018-09-09T05:22:46.200

Reputation: 4 630

Cracked by Bubbler – Jo King – 2018-09-12T04:39:33.150

4

Beatnik, Rust, ???

fn avreg(){}
fn/*azxzzz avreg k zqyzzz ax quke    
>>P0 ++puts++puts[pov]
\@�{>*}++puts++puts++puts++puts++puts++puts++puts++puts%
*/main(){print!("17")}

This prints 16 in Beatnik, 17 in Rust, and 18 in ???.

The character on line 4 should be replaced with ASCII character 18 (this was not done in the TIO links since it's not relevant to either of them).

Explanation (cracked):

The previous answer's language was Rust: specifically, Rust compiled with mrustc. mrustc is an experimental compiler, and as it is mostly intended for bootstrapping a valid version of rustc, it ignores borrow checking and mutability checking, allowing @NieDzejkob's snippet to compile without errors.

This program will work with the normal Rust compiler, so you don't need to install mrustc to test it.

Hints

Since this answer has now gone the longest without being cracked, I'll leave a hint, and continue to do so regularly until it is cracked:

  • The secret language is two-dimensional.
  • As I mentioned in the comments, the language is not on TIO.
  • The character is a red herring and has very little significance. Most bytes can be substituted in its place and the program will still work.

Esolanging Fruit

Posted 2018-09-09T05:22:46.200

Reputation: 13 542

1While throwing languages at this at random (having not found much searching for "ascii codepoint 0x12 esolang"), I noticed that it actually outputs 15 in ><>, so that's neat – Unrelated String – 2019-03-21T02:05:32.990

1It would appear that this doesn't print 18 in any language on TIO (without any header, footer, or command-line flags added at least). I do hope I didn't miss any, because it seems like it will probably be quite a bit harder to check through everything on esolangs, Wikipedia, and Rosetta Code... My best guess is that this is some sort of 2D language where either @, P, {, or m starts a character literal and something afterwards prints its codepoint in decimal, but that doesn't explain all of the ++s... – Unrelated String – 2019-04-02T22:37:16.227

1@UnrelatedString Yes, I will confirm that it isn't a language on TIO. – Esolanging Fruit – 2019-04-03T03:48:09.787

1Well, I might have wasted a day going through 100 languages on esolang.org trying to find one that fits... Then I read the ASCII 18 character thing and realized my approach was completely wrong as I searched for a totally different class of languages... – IQuick 143 – 2019-04-19T17:23:26.903

2@IQuick143 herrings are red – Esolanging Fruit – 2019-04-20T21:14:23.033

3

Z80Golf, Somme, ???

!!8@e6v+4>9 \
1((111+111)/111)
00
~tz

This prints 9 in Z80Golf, 10 in Somme and 11 in ???.

Credit to Bubbler for cracking the previous post as Somme, which takes the column sum as the instructions. The first three columns evaluate to

A.;

Which pushes 10, prints it and exits.

Jo King

Posted 2018-09-09T05:22:46.200

Reputation: 38 234

3

Somme, Trigger and ???

[,,E,D,,$,H,_,K,,$,,_,F,L]=!
[]+[]+!![]+[][111]
_=[111][F+L+E+E];[,J,,A,I,,B,C,S]=
[]+_;$=A+B+C+D+I+H+J+A+I+B+H
R=_[$](H+K+I+J+H+C+S+H+B+B+I)();G=($[$]+[])[14]
R[A+B+C+D+B+E+K][E+B+G](12);`
iP<`

This prints 10 in Somme, 11 in Trigger, and 12 in ???.

Since the last two languages are easy to polyglot, I decided to mix that language in.

Explanation (cracked post)

Trigger sees the whole code as a series of tokens (tokenization is greedy):

  • Single byte (denote A)
  • Two same bytes followed by a different byte (denote AAB)
  • Three same bytes (denoted AAA)
  • Four same bytes (denoted AAAA)

In the source code

!!8@e6v+4>9 \
1((111+111)/111)
00
~tz

the significant tokens are ((1 11+ 111 111, where the first two does nothing and the last two prints 1 each - thus 11.

Bubbler

Posted 2018-09-09T05:22:46.200

Reputation: 16 616

cracked – NieDzejkob – 2018-09-12T15:48:09.827

3

CHIP-8, Klein (100), ???

[ //aТ/\\ ][ //е"6
console.log(111-111+12)]
//!'!/-²6-²52@++++2345
 %/    <#> 13
       say 14
 + not not 15

Outputs 13 in CHIP-8 (I assume), 14 in Klein, and 15 in ???.

Another Klein topology, tsk tsk. I've preserved the code before the @, since I don't know what will affect CHIP-8.

Clues

I'm kinda overdue for these, sorry. I'll try and add one a day.

  • Removing the first half (first three lines) of the program still works.
  • This is not a 2D language
  • The language is on TIO
  • The nots and the say can be removed without affecting the program

For reference, the program without that stuff looks like this:

 %/    <#> 13
        14
 +   15

Try it online!

Jo King

Posted 2018-09-09T05:22:46.200

Reputation: 38 234

2

...I'm scared. This runs in Runic and outputs 16.

– Draco18s no longer trusts SE – 2018-09-29T17:48:11.967

@Draco18s Intentional – Jo King – 2018-09-30T00:29:14.783

It won't after my next update, as I added some better string handling to several operators (currently TIO pops a 1 and a string that is the made up from first line and goes "this isn't a value" and discards them, the update will concat, even though I have an operator for that, but concat operates on characters and numbers as well as strings, where as + treats them as numbers). But it was super spooky to be like "I wonder what...oh god, this could be left unmodified and be the next entry...if only I knew the ??? language..." – Draco18s no longer trusts SE – 2018-09-30T01:43:10.240

Are you defining half by bytes, characters, lines, or something specific? – NieDzejkob – 2018-10-08T16:42:52.887

I figured the language was on TIO. There are, however, 570 languages on TIO. :p – Draco18s no longer trusts SE – 2018-10-11T22:11:21.083

2Cracked. – Bubbler – 2018-10-12T01:18:04.650

3

Klein (100), Commentator, ???

/@++++2345
start:
program:
 db 'function',10
 add program,program
 jp null+$8
 sbc rbp,rbp
 jnz program
 jr program
 add start
 halt
ex:

Outputs 14 in Klein (100), 15 in Commentator, 16 in ???.

I'm seriously bad at obfuscating polyglots.

Explanation (Cracked post)

 %/    <#> 13
        14
 +   15

In Commentator, common comment tokens and spaces are the important commands, and any other characters are ignored.

  • Space increments the current memory cell.
  • <# does XOR 1 on the current memory cell.
  • % is used to reset the current memory cell to zero.

Wait, there are 16 spaces after %, what happened?

It's actually a small bug (or feature?) in the interpreter. / is treated as the start of a 2-char command, so the space after it is consumed. But /<space> is undefined command (thus a no-op), so the space is effectively skipped.

Bubbler

Posted 2018-09-09T05:22:46.200

Reputation: 16 616

cracked – NieDzejkob – 2018-10-12T20:43:07.400