# Challenge

Create 2 programs A and B

• The output of program A is exactly program B

• The output of program B is exactly program A

• Neither program should depend on inputs to yield the correct output

• A and B are not identical programs

• A and B are of different programming languages

• Neither program may be equivalent to itself in the other language. For example, if the chosen languages are C and C++, the C++ program must not be a valid and equivalent C program, else the "inter-language" requirement is redundant

A solution should include:

# Scoring

The score for a solution is:

• The length of the shortest program +

• The combined length of the names of both programming languages, as they appear on tio.run

The reason for this unusual scoring is because this constitutes the combined length of the minimum information necessary to communicate your solution.

This is my first post to Code Golf. Any edits to this post to increase clarity or appropriate vocabulary are welcome.

• Welcome to the site. I would really recommend removing the name penalty. "Common name" is not going to be clear for a lot of instances. I don't really get the reason this was included in the first place and it just leads to trouble down the road when people try to golf the language name. – Post Rock Garf Hunter Jan 11 at 1:26
• Also not an issue or even something that needs to be changed, but the penultimate and antepenultimate bullets are redundant, both are implied by the last bullet point. – Post Rock Garf Hunter Jan 11 at 1:27
• So essentially, this is a multi-language quine that can't be a polyglot. – Lyxal Jan 11 at 1:49
• @PostRockGarfHunter I did suspect that the "Common name" qualifier may cause some problems, but for now I'd like to leave it as a (maybe naive) experiment in seeing how such an odd type of scoring will play out. – Hymns For Disco Jan 11 at 1:51
• @Jono2906 no problem if either program can "speak" both languages, i.e. is a valid program in both languages, but if it gives the same output in both, that violates the last rule. See Jo King's answer – Hymns For Disco Jan 11 at 1:54

# ><> and Gol><>, 18 bytes + 3 + 6 = 27

'3d*:5-0@o~r{?H>o<


Try it online!

and

"3d*:5-0@o~r{?H>o<


Try it online!

Both output the same program, but with the first character flipped between ' and ". Neither program is equivalent to itself in the other language, since the behaviour of @ differs.

• So the first is a Gol><> quine and the second is a ><> quine that both just happen to produce the same output in the other language? Seems that makes them equivalent to me, but what do I know? – Neil Jan 11 at 1:29
• Indeed this solution is quite a "near-miss", but both programs have different outputs in each language as outputted by "try it online". I'm interested to see how the problem becomes (presumably) more complicated with non-golfing and more dissimilar languages – Hymns For Disco Jan 11 at 1:37
• Sure, by running the first program in ><> and the second program in Gol><> they output each other, but that's not what I said. – Neil Jan 11 at 1:42
• Yes this is a valid. By "near-miss" I meant that it narrowly dodges each restriction i.e. 1. the programs are not identical, 2. the languages are not the same, and 3. neither program is equivalent in the other language – Hymns For Disco Jan 11 at 1:42
• Ah I see now, both programs are equivalent to each other in the same language. – Neil Jan 11 at 1:44

# Jelly, 13 bytes + 8 = score 21

“Ṿ;⁾v+/ŒṘ”v


Try it online!

'“Ṿ;⁾v+/ŒṘ”v'