15
\$\begingroup\$

Write a code that runs or compiles in as many programming languages as possible and prints a newline separated list of names of previous and current programming languages.

  • Every used language must have 1 character longer name than previous; ex. C#, C++, Ruby, Jelly, Python...
  • Each language must output a list of language names separated with a newline, sorted by length.
    • Output must be a pyramid: The list can only contain used language names, that are shorter than the running script language name + the running script language's name.
  • Leading and trailing newlines are allowed.
  • Standard loopholes are forbidden.
  • It's not allowed to create custom programming languages just to increase the score.
  • Version numbers don't count in language name, but you can specify it in your post if there are any incompatible changes in new versions of the language.
  • You can decide if you want to use the shortcut for the language name or it's full name, but you can't submit both forms in one answer. You can use ex. either SPL or Shakespeare Programming Language.
    • Only letters, numbers, ASCII symbols and single spaces (not leading nor trailing) count in language name length.

Examples

Example outputs for C, C# and C++:

C

C

C#

C
C#

C++

C
C#
C++
\$\endgroup\$
  • \$\begingroup\$ Sandbox post \$\endgroup\$ – RedClover Feb 7 '18 at 20:02
  • 1
    \$\begingroup\$ There are plenty of languages with single-letter names: tio.run alone has 4, 7, C, D, I, J, K, M, R, and V. (Another significant one is B, the predecessor to C.) \$\endgroup\$ – Lynn Feb 7 '18 at 20:54
  • \$\begingroup\$ @Lynn But if you start from a longer language name you might lose score \$\endgroup\$ – RedClover Feb 7 '18 at 20:55
19
\$\begingroup\$

10 languages C, rk, ><>, Rail, Width, Gol><>, Fission, Cardinal, brainfuck, Befunge-98, 991 bytes

//Q rk:start print: "C^nrk" rk:end @,k*97C'a"rk"a"><>"a-1"Sail"a"Width"a"Gol><>"a"Fission"a"Cardinal"a"brainfuck"a"Befunge-98"
main(){puts("C");}
/*
$'main'
 \-[C\n\rk\n\><>\n\Rail]o

++++[++++>---<]>.>++++++++++.[------->+++<]>.-------.>++++++++++.[->++++++<]>++.--.++.>++++++++++.>-[--->+<]>---.[------>+<]>--.++++++++.+++.>++++++++++.[------>+<]>.+++[->++++<]>+.-----.--[--->+<]>--.------------.>++++++++++.[->+++++++<]>+.[--->+<]>++.---.--[->+++<]>.--.++.>++++++++++.[->+++++++<]>.[-->+++<]>.++++++++++..----------.++++++.-.>++++++++++.+[->++++++<]>+.-[-->+++<]>--.--[--->+<]>---.--------------.+++++.+++++.-------------.+++++++++++.>++++++++++.+[--->++++<]>--.[--->+<]>----.+++[->+++<]>++.++++++++.+++++.--------.-[--->+<]>--.+[->+++<]>+.++++++++.
R"C"N"rk"N"><>"N'S_!"ail"N"Width"N"Gol><>"N"Fission"*
/"><>krC"oaoooaooooE ao'liaR>'~ooooaoS"Width"aoS"Gol><>"; QQaAWAmcOAWAaicmaiWAAiwAOaOwWAAAOawmmFOcQww
 %"C"++++++++++,"rk","><>",=--t++,"ail"~,"Width","Gol><>","Fission","Cardinal"
 */

Try it online!

568 bytes of this is just the brainfuck code. The Befunge-98 program produces:

C
rk
><>
Rail
Width
Gol><>
Fission
Cardinal
brainfuck
Befunge-98
\$\endgroup\$
  • \$\begingroup\$ Can't you save 2 bytes by using puts instead of printf? \$\endgroup\$ – Neil Feb 8 '18 at 10:25
  • \$\begingroup\$ @Neil Thanks! (haven't golfed in C before (some would say i still haven't)) \$\endgroup\$ – Jo King Feb 8 '18 at 11:04
  • 2
    \$\begingroup\$ Nice! I would look into adding Parenthetic next — it ignores everything but ( and ), making it easy to quine with. \$\endgroup\$ – Lynn Feb 8 '18 at 12:46
9
\$\begingroup\$

7 languages (J, es, zsh, Bash, Straw, Retina, Fission), 222 bytes

echo 'J'
#0 : 0
echo es #(10)#»:::J>>(es)>>(zsh)>>(Bash)>>(Straw)>>
(echo zsh;)
if [[ $BASH_VERSION ]]; then echo Bash; fi
#              ;R"J"N"es"N"zsh"N"Bash"N"Straw"N'Q+!"etina"N"Fission"N;
K`J¶es¶zsh¶Bash¶Straw¶Retina

Try it online!

\$\endgroup\$
  • \$\begingroup\$ I know this isn't a code-golf challenge, but you can remove the N after "Fission" to save 1 byte. :) \$\endgroup\$ – Kevin Cruijssen Feb 8 '18 at 15:00
1
\$\begingroup\$

rk, sed, Swap, 65 bytes

s/.*/rk\nsed/
rk:start print: "rk"
r>"pawSdeskr"oo52*oooo52*ooooo

rk: Try it online!

sed: Try it online!

Swap: Try it online!

\$\endgroup\$

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.