Challenge:
Write a code that, when executed will output the source code of a second program that can be executed in another language. The second program should output the source code of a third program that can be executed in a third language and so on. The last program should output PPCG
with an optional single trailing newline.
The winner will be the submission with the most languages. Code length of the first program will be the tie breaker.
Important rules:
- No programs can be identical
- Each language must only work on one of the source codes. It should be impossible to use the same language two places in the chain without breaking it(see examples).
- A shortened chain is not a broken chain. If you can use a language in a different place than intended and the end result is still PPCG then it's invalid
- All versions of a language count as unique languages (but keep in mind rule number 2)
Examples:
An invalid submission:
print("""print'disp("PPCG")'""")
- Python 3:
print("""print'disp("PPCG")'""")
printsprint'disp("PPCG")'
- Python 2:
print'disp("PPCG")'
printsdisp("PPCG")
- Octave :
disp("PPCG")
printsPPCG
This works properly, but: you can run both the first and the second code in Python 2 without breaking the chain, so this violates rule number 2.
A valid submission with score 3:
print("""print'disp("PPCG")'""")
- Python 3:
print("""print'disp("PPCG")'""")
printsprint'disp("PPCG")'
- Perl :
print'disp("PPCG")'
printsdisp("PPCG")
- Octave :
disp("PPCG")
printsPPCG
This is the exact same code as the invalid example. The difference is, we have chosen languages that adhere to rule number 2: You can't run the first code in Perl/Octave, the second code in Python 3/Octave nor the last code in Python 3/Perl. This is valid even though Python 2 can run the two first programs, because we haven't used Python 2 as one of the languages.