26 languages: C, C++, Cubically, rk, what, Bash, Morse, Ook!, str, Charcoal, Commercial, S.I.L.O.S, memescript, Forked, TRANSCRIPT, Braingolf, Fission, Arcyou, Beam, Beatnik, Cood, COW, Emoji, ><>, Set, NTFJ
Over 1000 bytes >.< but I'm gonna go for the most languages.
Hit Page Down about 10 times if you don't want a description of all the languages.
#\
//ha kkkkkkkkkk ja ha kkkkkkkkkkd ja skd I7Oq2_
#include<stdio.h>//$+77%6& ..... rk:start print: "11" rk:end ?!!!!!!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!??!????! Ook. Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. ⎚8» ##########################################
/*
echo -n 3;exit
Hey, waiter!
I want 25 of this.
How much is it?
The bill, please.
foo now 9 dollars off!
foo has been selling out worldwide!
a = 10
printInt a
filler what the frick frack thumbtack diddily dack crack pack quarterback frick frack (p 22)
>F9+%&'L+:+:H
Ju is here.
>Ju, 32
>X Ju
set ! 50
set ! 56
oom MoO OOM 💬26💬➡ #####/
*/main(int a){getchar();printf("%d",sizeof(' '));}/* R"21"
>2n7n; */
This outputs:
(Links are not all current, I'll eventually update them. I have verified each language.)
C/C++
sizeof(' ')
is 1 in C++ and 4 in C. Here's the C/C++ code:
#include <stdio.h>
main(){getchar();printf("%d",sizeof(' '));}
#include <stdio.h>
is needed for C++. (This is why I don't like it.)
getchar();
is there because we still technically need input.
printf("%d",sizeof(' ')
prints 4 in C and 1 in C++.
Update - the echo -n 3;exit
is ignored via \
at the end of the comment on line 1.
Cubically ignores everything it doesn't care about as long as no functions get called.
$+7+7%6&
$ read int as input
+7+7 double it (could be +77, I'll golf everything more if it comes to that)
%6 print output
& exit (the `main()` would cause an infinite loop)
rk is horrible, but good for polyglotting. It ignores everything before rk:start
and after rk:end
:
rk:start print: "11" rk:end
Pretty simple. A010850 is a constant sequence. "Input is taken via command line arguments." :P
The what
interpreter reads three bytes at a time. Very stupid but useful.
?!!!??(x50)??!
Gets input (uselessly), goes to next memory cell, adds the ASCII value for 2 (50) to the current memory cell and outputs.
Bash
# <comment>
echo -n 3; exit
<everything ignored because parser already exited>
Also takes input via "command line arguments". I love constant sequences.
Morse Code is the oldest language used in this thread, I can guarantee. ;) This uses an interpreter I wrote last year for fun. It conveniently ignores everything it doesn't care about.
.....
Constant sequences probably weren't what the OP had in mind when creating the challenge...
Ook!
Ook! is a Trivial Brainf**k Substitution. The interpreter I found is really crappy, reads 11 characters at a time and checks if it's something it cares about. Pasting the code at the end of the first line magically lined it up properly, so the interpreter noticed the Ook! code.
Ook. Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook.
This is equivalent to Brainf**k's ,>+(x48).
. Read a character, move to next memory cell, increment to 48 (ASCII code for 0
) and print.
The str code wanted to be right at the top because something around #include <stdio.h>
made it bug out. I had to rearrange the what and Ook! code, since I added something before both of them.
# // I7Oq
#
is apparently a valid preprocessing token in C/C++. //
comments it out. (That's a capital letter o, in case your screen tries to deceive you.)
I
- read input
7
- push 7
O
- output
q
- turn off STDOUT just in case
I think it's real clever how I
is for input and O
is for output. Nice language, Conor!
Wow, I like this language, I'm gonna use it more sometime.
Luckily, there's a command to clear the output buffer, ⎚
. So it just echoes everything up to the ⎚
on line 2, then clears that. The Charcoal code we care about looks like this:
⎚8»
8 prints 8. »
exits with a parse error, which is allowed by default.
This one was a bit less nice because it wanted me to have its code on separate lines. I had to rearrange the C/C++ comments a bit.
For some reason, C emitted a warning and then didn't compile when I replaced the //
with /*
. So it's on its own line, making Bash annoyed but still prints the desired number.
foo now 9 dollars off!
foo has been selling out worldwide!
variable now x dollars off
creates a new variable variable
with value x
.
variable has been selling out worldwide!
prints the variable's value.
At least the interpreter is forgiving about unrecognized code...
Oh, I also updated all the TIO links. That was a pain so I'll probably only do so every 10 or when I quit working on this polyglot. Fun challenge, thanks!
That had one of the clearest, most concise READMEs I've ever seen. Simple as this:
a = 10
printInt 10
Adding this code didn't even break anything!
Why does this language exist >.<
The interpreter was being lame so I had to add filler
to get it to see what the
.
filler what the frick frack thumbtack diddily dack crack pack quarterback frick frack
what the
- start code
frick frack thumbtack
- push 11
diddily dack crack pack
- add 5
quarterback frick frack
- output as integer
Forked
Forked is my new 2d lang, it's only partially implemented. It's not in a triangle or a cube or anything interesting, it's just a fun simple esolang.
Unfortunately, having # // I70q
on the first line had a mirror /
in the way of the source code. I moved some things around so the mirrors look like this:
\
//
The mirrors are pretty self-explanatory; the code enters from the top left and exits at the bottom left. Then it hits this code near the bottom:
>F9+%&
>
directs the IP west. F
pushes 15, 9
pushes 9. +
adds them, %
prints as integer, &
exits.
Note: This may not work in future Forked versions, depending on how #
will handle invalidity.
This is a cool language. I don't really understand some of the syntax (specifically, >
), but it's fun nevertheless. Also forgiving about syntax errors which is why I chose to use it.
Here's the code we care about:
Ju is here.
>Ju, 32
>X Ju
Ju is here.
defines an NPC (variable) named Ju. (Short for Julie, which was used in the example.)
>Ju, 32
puts 32 in Ju's memory (sets it to 32).
>X Ju
prints Ju. (Where did X
come from?!?)
Apparently, the code does some wacked out stuff to the stack but outputs 0 at EOF, so I found a place I could put the code without breaking anything else, found a sequence that ended in 0, and let it do its implicit output at the end.
2_
Pushes 2 and prints it. 0
is printed at the end, printing 20. More constant sequences, yay!
For such a complicated language, this was pretty easy - just modified this:
R"21"
Prints 21. Surprisingly, putting this anywhere in the code worked just fine.
R
creates atom travelling right.
"21"
stores the string 21 in that atom.
- Implicit output at the end of the program, I guess.
Another language forgiving about syntax errors. Here's the code we care about:
(p 22)
Arcyou is pretty much identical to LISP, but golfier. p
is print, 22
is 22.
Also, it printed None
due to the main()
. I added a
there, C++ complained, I made it int a
and everything's running smoothly again.
The hardest part about adding this language was finding the spec. Luckily, there's a mirror of esolangs.org! Thanks, totallyhuman!
Beam uses the same control flow as Forked but that's it. So I put its code after Forked's exit command.
'L+:+:H
'
increments the store and L
sets the beam to the store. +
increments, :
outputs as integer.
I tried ++:+:H
first, but the beam apparently is not initialized to 0. The store is, though.
Beatnik is a language almost as awful as some I've written and am planning to write. It uses Scrabble word values. Here's its code:
ha kkkkkkkkkk ja ha kkkkkkkkkkd ja skd
Here is the Scrabble values for those:
5 50 9 5 52 9 17
5 50
- push 50
9
- print as ASCII
5 52
- push 52
9
- print as ASCII
17
- exit
I used a comma and a bunch of Z's initially, which messed with str. Fixed by removing the useless comma and changing 5 z's to 10 k's.
Cood cares about this (explanation on the right)
Hey, waiter! (start program)
I want 25 of this. (set memory to 25)
How much is it? (print as int)
The bill, please. (finish script)
Yay, a non-constant sequence! :D
oom MoO OOM
oom read integer
MoO increment
OOM print as integer
Emoji
💬26💬➡
💬..💬 push string
26 "26"
➡ print top of stack
><>
Another language I'm going to use more; I love how this wraps.
It initially hits #
, which bounces the IP backwards, wraps around, hits \
, which wraps vertically to the bottom, hits >
, then it sees 2n7n;
.
2n7n;
2 push 2
n output
7 push 7
n output
; exit
Set
I recall this being used in the answer-chaining polyglot. Luckily, ASCII-only's TIO interpreter doesn't care about syntax errors!\
set ! 50 (print 2)
set ! 56 (print 8)
That's another one of your langs I've used, Conor.... this is possibly the strangest. All I do is push truthy values (#
) and use /
to push the number of items on the stack to the stack and *
to print.
(line 3) ##########################################
(line 4) /*
(line 21) #####/
(line 22) *
I didn't really mess with the code in the middle. It probably does things to the stack, and this will probably be a pain down the road, but whatever, it works.