18
\$\begingroup\$

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:

  1. No programs can be identical
  2. 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
  3. 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")'""") prints print'disp("PPCG")'
  • Python 2: print'disp("PPCG")' prints disp("PPCG")
  • Octave : disp("PPCG") prints PPCG

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")'""") prints print'disp("PPCG")'
  • Perl : print'disp("PPCG")' prints disp("PPCG")
  • Octave : disp("PPCG") prints PPCG

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.

\$\endgroup\$
  • \$\begingroup\$ Related, but not a duplicate. \$\endgroup\$ – Stewie Griffin Jan 24 '17 at 22:21
  • \$\begingroup\$ Related, possible duplicate. Practically the same challenge, but the scoring system takes into account the length of the code. \$\endgroup\$ – ETHproductions Jan 24 '17 at 22:26
  • 3
    \$\begingroup\$ Ah yes, I hadn't really noticed rule 2. That makes it definitely not a duplicate in my eyes. \$\endgroup\$ – ETHproductions Jan 24 '17 at 22:32
  • 1
    \$\begingroup\$ Rule 2 makes Rule 1 redundant. \$\endgroup\$ – Pavel Jan 24 '17 at 23:27
  • \$\begingroup\$ It's unfortunate this challenge has the no-repeats rule, which is novel, but ALSO has the "must end with PPCG" instead of it being otherwise a normal ouroboros challenge. \$\endgroup\$ – Sparr Jan 25 '17 at 2:01

11 Answers 11

12
\$\begingroup\$

12 languages, 64 bytes

Charcoal -> tinylisp -> Python 3 -> /// -> Python 2 -> Perl -> QBasic -> Pip -> V -> Retina -> Pyth -> GolfScript

Charcoal

P(q(print('/x/print/x"""x q<?"`i.*":?CHR$(34)+"\'PPCG\'`">"""'*1

Any run of printable ASCII is a string literal in Charcoal. can be used for multidirectional printing, but in this case it simply prints the string going rightward.

tinylisp

(q(print('/x/print/x"""x q<?"`i.*":?CHR$(34)+"\'PPCG\'`">"""'*1

The only reserved characters in tinylisp (as of this writing) are parentheses and whitespace. Any other run of characters is a token, even something like +"\'PPCG\'`">"""'*1. Parentheses define lists. The q (quote) builtin returns its argument unevaluated--in this case, the nested list (print ('/x/print/x"""x q<?"`i.*":?CHR$ (34) +"\'PPCG\'`">"""'*1)). (Missing parentheses at the end are autocompleted.)

Python 3

(print ('/x/print/x"""x q<?"`i.*":?CHR$ (34) +"\'PPCG\'`">"""'*1))

Since print is a function in Python 3, we can wrap it in parentheses with no problem. In Python 2, where it's a statement, this is a syntax error. Unfortunately, Perl is fine with the parentheses, so we also do *1 (string repetition in Python, cast to int and multiply in Perl).

///

/x/print/x"""x q<?"`i.*":?CHR$ (34) +"'PPCG'`">"""

/x/print/ changes x to print in the rest of the program, which has no slashes and therefore is output with no further changes.

Python 2

print"""print q<?"`i.*":?CHR$ (34) +"'PPCG'`">"""

No parentheses after print, doesn't work in Python 3. Perl doesn't like the triple quotes.

Perl

print q<?"`i.*":?CHR$ (34) +"'PPCG'`">

Perl's various ways of quoting a string are helpful, and distinct from other languages. Here we use q<...>.

QBasic

?"`i.*":?CHR$ (34) +"'PPCG'`"

A couple of print statements (abbreviated as ?), using CHR$(34) to get a double quote.

Pip

`i.*
"'PPCG'`

A single Pattern (regex) literal in backticks.

V

i.*
"'PPCG'

Switch to insert mode, add some text.

Retina

.*
"'PPCG'

Match anything and replace it with the second line.

Pyth

"'PPCG'

Pyth quotes don't need to be matched (which makes this not a valid program in Pip).

GolfScript

'PPCG'
\$\endgroup\$
  • \$\begingroup\$ Any documentation on charcoal? \$\endgroup\$ – ev3commander Jan 27 '17 at 0:32
  • \$\begingroup\$ @ev3commander Sort of. See list of commands, brief notes on syntax (mainly literals), and code page. But yeah, the documentation isn't great. I added some explanation to the answer, too. \$\endgroup\$ – DLosc Jan 27 '17 at 3:51
  • \$\begingroup\$ ah. I was wondering because the P wasn't actually a pure ASCII p, but I guess it was so that it wouldn't print "Pprint...." not "print...." \$\endgroup\$ – ev3commander Jan 28 '17 at 0:18
  • \$\begingroup\$ Add bash: echo '…' to the beginning \$\endgroup\$ – OldBunny2800 Jan 28 '17 at 20:01
7
\$\begingroup\$

Java --> C --> Ruby --> /// --> Python 3 --> Batch --> JavaScript --> BrainFuck (8 Languages)


Click the language names for the code through each execution, except for Batch, because I couldn't find an online interpreter for it.


class Main {public static void main(String[]args){System.out.println("int main(){printf(\"puts \\\"/code/print('echo console.log(\\\\\\\\'-[--->+<]>-----..-[----->+<]>.++++.\\\\\\\\\')')/code\\\"\");}");}}

Explanation:

Java outputs int main(){printf("puts \"/code/print('echo console.log(\\\\'-[--->+<]>-----..-[----->+<]>.++++.\\\\')')/code\"");}
C outputs puts "/code/print('echo console.log(\\'-[--->+<]>-----..-[----->+<]>.++++.\\')')/code"
Ruby outputs /code/print('echo console.log(\'-[--->+<]>-----..-[----->+<]>.++++.\')')/code
/// outputs print('echo console.log(\'-[--->+<]>-----..-[----->+<]>.++++.\')')
Python outputs echo console.log('-[--->+<]>-----..-[----->+<]>.++++.')
Batch outputs console.log('-[--->+<]>-----..-[----->+<]>.++++.')
JavaScript outputs -[--->+<]>-----..-[----->+<]>.++++.
BrainFuck outputs PPCG
\$\endgroup\$
  • \$\begingroup\$ The Rhino interpreter for JavaScript can run the Python program, thus repeating a language. So whether this answer's valid or not depends on exactly how the rules on interpreters work. \$\endgroup\$ – user62131 Jan 25 '17 at 6:17
  • 1
    \$\begingroup\$ @ais523 although print() works in JavaScript, it does not output anything, and in fact attempts to print the page, so I don't think that counts. \$\endgroup\$ – TrojanByAccident Jan 25 '17 at 6:19
  • 3
    \$\begingroup\$ If i understood the rules correctlu your score should be 1 as running the original code in BF ouptut PPCG \$\endgroup\$ – Sefa Jan 25 '17 at 8:55
  • 2
    \$\begingroup\$ @Sefa Well, not exactly--I think there's always a null byte (ASCII 0) output first, because of the . in console.log. \$\endgroup\$ – DLosc Jan 25 '17 at 10:54
  • 1
    \$\begingroup\$ Good thing I didn't use alert ;) \$\endgroup\$ – TrojanByAccident Jan 25 '17 at 20:36
6
\$\begingroup\$

Java -> BotEngine -> Treehugger -> Loader -> Batch -> Thue -> Microscript II -> BF -> ForceLang -> Javascript, 10 languages

Java program:

public class ManyLang {
    public static void main(String[]arg){
        int m=120;
        String e="++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++^^^^^^^^^^^^^^^^-]>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>+.-^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++^^^^^^^^>>>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>--.++^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>>>>>>----.++++^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>>>>>>----.++++^^^^^^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++^^^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>+.-^^^^^^^>>>>>>>-.+^^^^^^^.";
        for(int i=1;i<e.length();i++){
            if(i==1){
                System.out.print("v");
            }
            else if(i%m==1&&i>1){
                System.out.println();
                System.out.println(">eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev");
                System.out.println("v                                                                                                                        <");
                System.out.print(" ");
            }
            System.out.print(e.charAt(i-1));
        }
        System.out.println();System.out.print(">eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeP");
    }
}

BotEngine program:

v++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ++++++++>+++++++++++++++>++++++++++++++++^^^^^^^^^^^^^^^^-]>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>+.-^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^^^>>>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.-
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 --^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>-
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 -.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>---.+++^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 +^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 +.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 .---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 +++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>--.++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.--
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 -^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.++
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 +^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^>>>>>>--.++^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>--.++^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>>>>>>----.++++^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>----.++++^^^^^^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 >>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++^^^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 --^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>++.--^^^^>>>>.^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeev
v                                                                                                                        <
 ^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>+.-^^^^^^^>>>>>>>-.+^^^^^^^
>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeP

Treehugger program:

++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++^^^^^^^^^^^^^^^^-]>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>+.-^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++^^^^^^^^>>>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>>>>>>>+++.---^^^^^^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>>>>----.++++^^^^^^^^>>>>>>>>>>>>---.+++^^^^^^^^^^^^>>>>>>>>--.++^^^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>+++.---^^^^^>>>>>+++.---^^^^^>>>>>>--.++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>---.+++^^^^^^>>>>>>--.++^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>--.++^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>>>>>>----.++++^^^^^^^>>>>>>----.++++^^^^^^>>>>>>+++.---^^^^^^>>>>>>>----.++++^^^^^^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>---.+++^^^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>>>>>>----.++++^^^^^^>>>>>>>---.+++^^^^^^^>>>>>>>.^^^^^^^>++.--^>>>>>>>>>>>>>>.^^^^^^^^^^^^^^>>>>>>>>>>>>>>++.--^^^^^^^^^^^^^^>>>>>>>>>>>>>+.-^^^^^^^^^^^^^>>>>>>>>>>>>>>--.++^^^^^^^^^^^^^^>>>>>>>>>>>>>>>----.++++^^^^^^^^^^^^^^^>>>>>>>>>>>>>--.++^^^^^^^^^^^^^>>>>.^^^^>>>>++.--^^^^>>>>>>>>.^^^^^^^^>>>>>>>>>>>>>---.+++^^^^^^^^^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>>>>>>>>>.^^^^^^^^^^^^^>>>>>>>>>>>>>>-.+^^^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>>---.+++^^^^^>>>>>>>>>>>>+++.---^^^^^^^^^^^^>>>>++.--^^^^>>>>.^^^^>>>>>>+++.---^^^^^^>>>>>>++.--^^^^^^>>>>>>----.++++^^^^^^>>>>>>>+.-^^^^^^^>>>>>>>-.+^^^^^^^.

Loader program:

printf "@echo%ca%c%c=~%c+[----->+++<]>++.++++++.[->+++++<]>+++.[--->++<]>+++.-----.---------.+++++++++++.+++[->+++<]>.--[--->+<]>-.++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.-.+[->++<]>..-[----->+<]>.++++.+[-->+<]>+++.++.-------.%c." 32,58,58,34,34
printf "@echo%c%c%c=" 32,58,58
printf "@echo%c%c" 32,97

Batch program:

@echo a::=~"+[----->+++<]>++.++++++.[->+++++<]>+++.[--->++<]>+++.-----.---------.+++++++++++.+++[->+++<]>.--[--->+<]>-.++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.-.+[->++<]>..-[----->+<]>.++++.+[-->+<]>+++.++.-------.".
@echo ::=
@echo a

Thue program:

a::=~"+[----->+++<]>++.++++++.[->+++++<]>+++.[--->++<]>+++.-----.---------.+++++++++++.+++[->+++<]>.--[--->+<]>-.++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.-.+[->++<]>..-[----->+<]>.++++.+[-->+<]>+++.++.-------.".
::=
a

Microscript II program:

"+[----->+++<]>++.++++++.[->+++++<]>+++.[--->++<]>+++.-----.---------.+++++++++++.+++[->+++<]>.--[--->+<]>-.++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.-.+[->++<]>..-[----->+<]>.++++.+[-->+<]>+++.++.-------.".

BF program:

+[----->+++<]>++.++++++.[->+++++<]>+++.[--->++<]>+++.-----.---------.+++++++++++.+++[->+++<]>.--[--->+<]>-.++.+[--->+<]>.+++++++++++.-------.+++++++++++++.++.+[--->+<]>+.-.+[->++<]>..-[----->+<]>.++++.+[-->+<]>+++.++.-------.

ForceLang program:

io.write "alert('PPCG')"

Javascript program:

alert('PPCG')
\$\endgroup\$
  • \$\begingroup\$ Can you list the steps? \$\endgroup\$ – OldBunny2800 Jan 28 '17 at 20:02
  • \$\begingroup\$ @OldBunny2800 Done. \$\endgroup\$ – SuperJedi224 Jan 28 '17 at 20:29
4
\$\begingroup\$

11 languages, 536 bytes

Bash -> Python 3 -> Go -> Lua -> Rust -> Java -> C99 -> Python 2 -> JavaScript -> Ruby -> Batch

Bash:

e="echo -n "
p(){
eval "for i in {1..$1}
do
$e'\'
done"
}
$e'import sys;print("package main\nimport \"fmt\"\nfunc main() {fmt.Printf(\"if 1 == 1 then print(\\\"fn main() {let s='
p 7
$e'"public class Main{public static void main(String[] args){System.out.println('
p 15
$e'"#include <stdio.h>'
p 16
$e'nint main() {printf('
p 31
$e'"print '
p 63
$e"\"alert('puts "
p 128
$e"'@echo PPCG"
p 128
$e"'');"
p 63
$e'"'
p 31
$e'");}'
p 15
$e'");}}\\\\\\\";println!(\\\\\\\"{}\\\\\\\", s);}\\\") end\")}") if sys.version_info[0]==3 else exit()'

The p function reduces the code size by 497 bytes compared to typing all backslashes manually.

Python 3:

import sys;print("package main\nimport \"fmt\"\nfunc main() {fmt.Printf(\"if 1 == 1 then print(\\\"fn main() {let s=\\\\\\\"public class Main{public static void main(String[] args){System.out.println(\\\\\\\\\\\\\\\"#include <stdio.h>\\\\\\\\\\\\\\\\nint main() {printf(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"print \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"alert('puts \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'@echo PPCG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'');\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");}\\\\\\\\\\\\\\\");}}\\\\\\\";println!(\\\\\\\"{}\\\\\\\", s);}\\\") end\")}") if sys.version_info[0]==3 else exit()

The obligatory Python 2/3 differentiation.

Go:

package main
import "fmt"
func main() {fmt.Printf("if 1 == 1 then print(\"fn main() {let s=\\\"public class Main{public static void main(String[] args){System.out.println(\\\\\\\"#include <stdio.h>\\\\\\\\nint main() {printf(\\\\\\\\\\\\\\\"print \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"alert('puts \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'@echo PPCG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'');\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\");}\\\\\\\");}}\\\";println!(\\\"{}\\\", s);}\") end")}

Lua:

if 1 == 1 then print("fn main() {let s=\"public class Main{public static void main(String[] args){System.out.println(\\\"#include <stdio.h>\\\\nint main() {printf(\\\\\\\"print \\\\\\\\\\\\\\\"alert('puts \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'@echo PPCG\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'');\\\\\\\\\\\\\\\"\\\\\\\");}\\\");}}\";println!(\"{}\", s);}") end

Using if 1 == 1 then prevents Python compatibility.

Rust:

fn main() {let s="public class Main{public static void main(String[] args){System.out.println(\"#include <stdio.h>\\nint main() {printf(\\\"print \\\\\\\"alert('puts \\\\\\\\\\\\\\\\'@echo PPCG\\\\\\\\\\\\\\\\'');\\\\\\\"\\\");}\");}}";println!("{}", s);}

Java:

public class Main{public static void main(String[] args){System.out.println("#include <stdio.h>\nint main() {printf(\"print \\\"alert('puts \\\\\\\\'@echo PPCG\\\\\\\\'');\\\"\");}");}}

C99:

#include <stdio.h>
int main() {printf("print \"alert('puts \\\\'@echo PPCG\\\\'');\"");}

Python 2:

print "alert('puts \\'@echo PPCG\\'');"

JavaScript:

alert('puts \'@echo PPCG\'');

Ruby:

puts '@echo PPCG'

Batch:

@echo PPCG
\$\endgroup\$
  • \$\begingroup\$ Welcome to PPCG and nice first answer! \$\endgroup\$ – Cows quack Feb 4 '17 at 14:54
4
\$\begingroup\$

Befunge (5 versions)

We start with the most recent version, Befunge-109 (run with cfunge -s 109):

1k!!k@"1k!k@#;>@,k>'"'""r;@;"'"::''\"@_,#:>"'""\''::"'":''\"1j#@0"'""\'':"'":''\"::''\"'"::''\"GCPP"'""\'':"'":''\"::''\"'"::''\">:#,_@"'""\''::"'":''\"@j1A"'"::''\">:#,_@"'"";@r"'qk,@

Which outputs the following Befunge-98 code (Try it online!):

r@;"@_,#:>"'""A1j@"'"::''\"@_,#:>"'""\''::"'":''\"PPCG"'""\''::"'":''\"0@#j1"'"::''\">:#,_@"'"";@;r"'>k,@>;#@k!k1

Which output the following Befunge-97 code (Try it online!):

r;@;"@_,#:>"'""1j#@0"'"::''\"GCPP"'"::''\">:#,_@"'""@j1A">:#,_@

Which output the following Befunge-96 code (Try it online!):

A1j@"@_,#:>"'""PPCG"'""0@#j1">:#,_@

Which outputs the following Befunge-93 (Try it online!):

1j#@0"GCPP">:#,_@

Which outputs the string: PPCG

Each program will only run in the version of Befunge that it is targetting. If you try to run them in another version, they will exit immediately without outputting anything.

Thanks to Dennis, nearly all versions of Befunge are now available online at TIO. The only exception is Befunge-109, for which you'll need cfunge, which can be found here.

\$\endgroup\$
3
\$\begingroup\$

11 languages (102 bytes)

I'm going to add more soon.

Jelly -> Ruby -> ><> -> /// -> Batch -> Python 3 -> JavaScript -> J -> FOG -> Jolf -> Stacked

“puts <<q
/!/@ECHO print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")/!~
/0v
  >:1+$0g:'~'=?;o
q

Jelly (Try it online!) outputs:

puts <<q
/!/@ECHO print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")/!~
/0v
  >:1+$0g:'~'=?;o
q

Ruby (Try it online!) outputs:

/!/@ECHO print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")/!~
/0v
  >:1+$0g:'~'=?;o

><> (use this interpreter; it outputs spaces instead of null bytes for spaces) outputs:

/!/@ECHO print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")/!

/// (Try it online!) outputs:

@ECHO print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")

Batch outputs:

print("""console.log(`'"a Lq5(80::13-:4+)#:out"X'`)""")

Python 3 (Try it online!) outputs:

console.log(`'"a Lq5(80::13-:4+)#:out"X'`)

JavaScript (Try it online!) outputs:

'"a Lq5(80::13-:4+)#:out"X'

J (Try it online!—only an approximation) yields:

"a Lq5(80::13-:4+)#:out"X

FOG prints:

a Lq5(80::13-:4+)#:out

Jolf (Try it here!) outputs:

(80::13-:4+)#:out

Finally, Stacked (Try it here!) outputs:

PPCG
\$\endgroup\$
3
\$\begingroup\$

Windows Batch -> Powershell -> Ruby -> Python 3 -> JavaScript -> SQL -> CJam: 7 languages

Windows Batch

@echo @"
@echo puts <<x
@echo print("""alert(`prompt '"PPCG"'`)""")
@echo x
@echo "@

Powershell

@"
puts <<x
print("""alert(`prompt '"PPCG"'`)""")
x
"@

Ruby

puts <<x
print("""alert(`prompt '"PPCG"'`)""")
x

Python 3

print("""alert(`prompt '"PPCG"'`)""")

JavaScript

alert(`prompt '"PPCG"'`)

SQL

prompt '"PPCG"'

CJam

"PPCG"
\$\endgroup\$
  • 1
    \$\begingroup\$ I think (in the title) you mean Batch, not Bytch? \$\endgroup\$ – FlipTack Jan 28 '17 at 8:19
2
\$\begingroup\$

/// to Jelly to Javascript to MS-SQL to QBasic to QBIC, 39 bytes, 6 languages

/b/“a/blert("select'PRINT\"?@PPCG`\"'")

Explanation:

///  Replaces the one 'b' with '“a', returns 
“alert("select'PRINT\"?@PPCG`\"'")

Jelly just sees everything as a string literal and prints it (shamelessly stole this trick from @ConoroBrien)
alert("select'PRINT\"?@PPCG`\"'")

Javascript posts this in a dialog window:
select'PRINT"?@PPCG`"'

MSSQL then selects:
PRINT"?@PPCG`"'")

QBasic puts this on the screen:
?@PPCG`

QBIC then prints 'PPCG'

QBIC and QBasic have many similarities. However, these lines of code are not cross-compatible: QBasic accepts the ? as shorthand for PRINT, but does not know what to do with the @ and the backtick. QBIC will interpret the PRINT line as a reference to 5 different string variables and P$R$I$N$T$ is not a valid statement.

\$\endgroup\$
  • 2
    \$\begingroup\$ I love the blert ;-) \$\endgroup\$ – ETHproductions Jan 25 '17 at 20:51
2
\$\begingroup\$

9 languages: Processing -> Java -> C -> Python 3 -> JavaScript (ES6) -> Octave -> Bash -> sed -> V, 160 bytes

print("class A{public static void main(String[]a){System.out.print(\"main(){printf(\\\"print(\\\\\\\"alert`disp('echo s/.*/iPPCG/')`\\\\\\\")#\\\");}\");}}");//

Right now my objective is to find and add languages where I don't need to escape quotes and stuff.

Processing outputs (note that the the Java program doesn't run in Processing and vice-versa)

class A{public static void main(String[]a){System.out.print("main(){printf(\"print(\\\"alert`disp('echo s/.*/iPPCG/')`\\\")#\");}");}}

Java outputs:

main(){printf("print(\"alert`disp('echo s/.*/iPPCG/')`\")#");}

C outputs:

print("alert`disp('echo s/.*/iPPCG/')`")#

Python 3 (note that the python program won't work in Processing because of the comment and vice-versa) outputs:

alert`disp('echo s/.*/iPPCG/')`

JavaScript outputs:

disp('echo s/.*/iPPCG/')

Octave outputs:

echo s/.*/iPPCG/

Bash outputs:

s/.*/iPPCG/

sed outputs:

iPPCG  

V outputs:

PPCG

\$\endgroup\$
1
\$\begingroup\$

Python 2 -> Bash -> MySQL -> PHP

int score = 4;


print """echo "SELECT 'printf(\\"PPCG\\");';\""""

Even though this isn't code golf, the bytecount is 49.


Python outputs:

echo "SELECT 'printf(\"PPCG\");';"

Bash outputs:

SELECT 'printf("PPCG");';

MySQL outputs:

printf("PPCG");

PHP outputs:

PPCG

There you go!

\$\endgroup\$
1
\$\begingroup\$

New to codegolf, just trying to make an entry. Not trying to win. Am I doing this right?

Bash -> Batch - 23 bytes

printf "echo PPCG">.bat

This will output "echo PPCG" to a .bat which can be executed in windows.

\$\endgroup\$
  • \$\begingroup\$ Hello and welcome to the site. This answer looks perfectly valid, but I would recommend putting your score (2) in your title. This question is a code-golf question so there is no need to include your byte count unless you want to. \$\endgroup\$ – Sriotchilism O'Zaic Jan 29 '17 at 5:12
  • \$\begingroup\$ I think maybe wheat wizard forgot a "not" in there. This is not code golf. Also, welcome 😊 \$\endgroup\$ – Stewie Griffin Jan 29 '17 at 7:58
  • \$\begingroup\$ @StewieGriffin "Code length of the first program will be the tie breaker." hmm... \$\endgroup\$ – Erik the Outgolfer May 30 '18 at 18:19
  • \$\begingroup\$ I agree, but then the wizard's comment doesn't make sense: This question is a code-golf question so there is no need to include your byte count. \$\endgroup\$ – Stewie Griffin May 30 '18 at 18:55

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.