10
\$\begingroup\$

Challenge

Write two programs that:

  • run in two different programming languages.
    • These may not be two versions of one language.
  • when one program is run, it outputs the second program, and vice versa.
  • The two programs must be different (no polyglots).

Here's the catch though:

  • The programs must be radiation hardened.
    • This means that when any set of \$n\$ (defined below) characters is removed from either of the two programs, their functionality is unaffected.
    • \$n\$ is defined as the number of characters that may be omitted with your program's functionality unaffected.
    • \$n\$ must be at least \$1\$.

Rules

  • Standard loopholes are disallowed.
  • Your programs must be proper cyclic quines. They may not read their own source code.
  • Scoring is performed as follows:
    • Your score is \$\frac{S_1+S_2}n\$
    • where \$S_1\$ and \$S_2\$ are the size of your first and second programs respectively…
    • and \$n\$ is as defined above.
  • This is a , lowest score wins.

Reward

As this challenge is difficult to answer, I will be giving a bounty to the first person to answer.

\$\endgroup\$
  • \$\begingroup\$ Must the programs be proper quines? \$\endgroup\$ – Mego May 30 '17 at 23:49
  • \$\begingroup\$ @Mego Whoops - forgot to mention that. Yes. \$\endgroup\$ – dkudriavtsev May 30 '17 at 23:51
  • \$\begingroup\$ Well, "proper quine" isn't the right term since they're not quines, but it seems you understood what I meant. \$\endgroup\$ – Mego May 30 '17 at 23:53
  • 10
    \$\begingroup\$ Personally, I don't think this really adds much to the semiquine and radiation-hardening quine challenges we've already had; both categories have already been thrown together in so many combinations that it's extremely hard to come up with a truly original combination. \$\endgroup\$ – ETHproductions May 31 '17 at 1:55
  • 2
    \$\begingroup\$ You should probably add some kind of reward for answering this. I feel like it's too extremely difficult for many people to want to try. I saw this had no answers and I was thinking "ooh a quine challenge, I love those!" but then I read ALL THE RULES and it completely deterred me. \$\endgroup\$ – MD XF May 31 '17 at 18:01
3
\$\begingroup\$

Gol><> and ><>, (117 bytes + 117 bytes)/1 = 234

Gol><>

\\<<'3d*}}}}~}:r0<}!o::! ?>~~a<o>Hr~Kl a}}:?%2l}}}ss2"<<\\
\\<<'3d*}}}}~}:r0<}!o::! ?>~~a<o>Hr~Kl a}}:?%2l}}}ss2"<<\\

Try it online!

><>

\\<<"2ss}}}l2%?:}}a lK~rH>o<a~~>? !::o!}<0r:}~}}}}*d3'<<\\
\\<<"2ss}}}l2%?:}}a lK~rH>o<a~~>? !::o!}<0r:}~}}}}*d3'<<\\

Try it online!

Verification!

These two programs are the same, just reversed. They both follow the same general code structure.

Explanation (Gol><> on top, ><> on the bottom)

\\<<                           <<\\  Transition to the copy of the code that is not radiated
\\<<                           <<\\

                              "    Wrapping string literal over the rest of the code
                              '

                           ss2     Push the string character
                           *3d

                        }}}        Rotate the "<<\" to the correct end of the stack
                        }}}

                 }}:?%2l           Use the extra \ to replace a possible irradiated copy
                    }~}:

       ~     lK                    Duplicate the code
        ~~>? !::o!}<0r             Print a copy of the code in reverse

                a                  Push a newline
       a
    Hr                             Reverse, print the rest of stack and terminate
    >o<                            Print the rest of the stack and terminate
\$\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.