Your goal is to write a program that prints the string abc
in two languages. However, while the full code will print abc
in one language (we'll call it Language 1), the other one (Language 2) must print abc
if (and only if) every other character is skipped starting from the second character. If the full code is run in language 2, it must throw an error. If the skipped code is run in language 1, likewise, it must throw an error.
Rules and Clarification
- Trailing newlines are allowed.
- Output must be lowercase.
- "Run" means compiled for compiled languages.
- We will define "throwing an error" as outputting nothing to STDOUT and something to STDERR.
Test Cases
Language 1: 12345 -> abc
Language 1: 135 -> error
Language 2: 135 -> abc
Language 2: 12345 -> error
Scoring
The shortest code in bytes wins (the full code, not the skipped code).
Edit: I have clarified the rules based on feedback in the comments. The existing answers should still be valid.
ABC
instead ofabc
)? \$\endgroup\$