Typically, polyglots are constructed in such a manner that each language can ignore parts of the code that are present for other languages, by wrapping them in string literals, using comment syntax, or other similar tricks.
Your goal is to write a polyglot where the output for each language is the code from the polyglot that produces that output. Specifically, the output must be constructed from the polyglot code with only deletions, and it must be a quine in the given language.
Rules
- Only proper quines are allowed (no reading the source code, no taking input, output must be to STDOUT or closest alternative if STDOUT is not an option, and the programs must consist of more than just literals that are implicitly printed).
- Since different languages can use different encodings, the raw bytes are what matters here. For example, if language A uses UTF-8 and language B uses CP437, the (hex) code
C3 88 46 47
would beÈFG
for language A andÈFG
for language B. - All outputs must be distinct (again, comparing raw bytes). This avoids complications with trying to restrict minor language versions - if two languages use the same part of the code to do the same thing, you can't claim them both.
- If you have two languages A and B such that
XY
is a valid output in both, butYZ
is also valid in B, you may chooseXY
as the output for A andYZ
as the output for B, so you can claim both of them in your score (but you can't claimXY
for both languages because of the above rule).
- If you have two languages A and B such that
- All outputs must be as short as possible. For example, if your code was
print('foo')#something
, for Python 3 (ignoring the fact that the output is not correct), the code you would need to output would beprint('foo')
, andprint('foo')#
would not be allowed. If there are multiple strings of equal (minimal) length that produce correct output, you may choose any one of them. - Submissions must be polyglots in at least 2 languages.
- Your score will be given by
(number of programming languages with distinct outputs)**3/(total byte size of polyglot)
. The highest score wins. In the event that two submissions achieve the same score, the submission that reached that score first will win.