The task
In this challenge, your task is to write three programs that form a kind of mutual quine-like system.
Let's call the programs A
, B
and C
.
If one of the programs is given the source of another program as input, it shall output the source of the third program.
For example, if A
is given B
as input, it outputs C
.
If the programs are given their own source as input, they shall output the three strings "three"
, "mutual"
, and "quines"
(without quotes).
In all cases, they may output one additional trailing newline.
For any other inputs, the programs may do anything, including crash.
Example
For example, suppose that the source codes of A
, B
and C
are aSdf
, ghJk
and zxcV
.
Then the programs should behave as follows.
Source Input Output
--------------------
aSdf aSdf three
aSdf ghJk zxcV
aSdf zxcV ghJk
ghJk aSdf zxcV
ghJk ghJk mutual
ghJk zxcV aSdf
zxcV aSdf ghJk
zxcV ghJk aSdf
zxcV zxcV quines
Rules and scoring
The solutions A
, B
and C
can be either functions or full programs, but they must be completely independent: no shared code is allowed.
Standard loopholes and quine rules apply, so the programs can't access their own source codes in any way.
Your score is the combined byte count of A
, B
and C
, lower score being better.
public static void main
part somewhere.) Or just that you can't write a function which is called by all three? \$\endgroup\$