Create a program that can be run in 4 different languages such that:
- One language prints "Hello World!"
- One language outputs its own source code
- One language outputs 99 bottles of beer on the wall, that is:
99 bottles of beer on the wall 99 bottles of beer Take one down, pass it around 98 bottles of beer on the wall 98 bottles of beer on the wall 98 bottles of beer Take one down... <the pattern continues for a while> ...pass it around 1 bottle of beer on the wall 1 bottle of beer on the wall 1 bottle of beer Take one down, pass it around No more bottles of beer on the wall
- One language takes a nonnegative integer as an input and outputs that integer + 1
Rules and Scoring
- This is code golf, so shortest code wins. Score in character count rather than byte count for this challenge so that golfing languages that use specialized codepages are not disadvantaged by their UTF-8 representations.
- Standard rules and loopholes apply
- Each language may optionally output a trailing newline for its designated output
- Each language may use any I/O convention that is convenient to that language. The convention does not need to be consistent across all four languages; for instance, one uses stdout, another uses the return value, one writes to a file, and the last one spawns an alert containing the text.
- Golfing languages that have the option to use specialized codepages must use a standard encoding; they may not take advantage of a byte being interpreted as a different character in another encoding.
- Hello World may optionally include a comma after "Hello", thus
Hello, World!
is a valid output. - Standard quine rules apply and the only superfluous output allowed is a trailing newline.
- Text, or any other "language" where all programs are quines, is not a valid language for the quine.
- 99 Bottles of Beer requires:
- A blank line between each verse
- No blank lines within any verse
- The singular/plural distinction of 'bottle' vs 'bottles'
no more
instead of0
on the last line- Each line may have any amount of trailing whitespace (or none at all)
- The incrementing program must support all input integers that can be incremented natively by its language.
- For languages which support unsigned integers, the largest unsigned integer should be used
- For languages which represent all numbers as floating point numbers, this would require supporting all input numbers up to \$2^{53}-1\$.
- For languages which natively support arbitrary-sized integers, all positive integers must be supported.
Format the header of your answer like this:
# <language for H, <language for Q>, <language for 9>, <language for +>, n characters
+
in HQ9+ inputs or outputs anything. \$\endgroup\$# <language for H>, <language for Q>, <language for 9>, <language for +>, n characters
. \$\endgroup\$