54 Languages, 1331 bytes
><>,
Gol><>,
Foo,
Befunge-93,
Befunge-98,
brainfuck,
Brain-Flak,
Python 2,
Python 3,
Hexagony,
Perl,
Ruby,
Julia,
Cardinal,
Brainbash,
Turtlèd,
Deadfish~,
Whitespace,
Braille,
Rail,
Fission,
ETA,
Trigger,
Self-modifying Brainfuck,
Numberwang,
Actually,
Emoji,
Symbolic Brainfuck,
TinCan,
Alphuck,
Shove,
Cood,
Wise,
Width,
Whispers,
Thue,
Surface,
Stones,
evil,
Set,
Prelude,
Gaot++,
Cubix,
Cubically,
PATH,
Commercial,
Brian & Chuck,
Monkeys,
Nhohnhehr,
Beam,
AsciiDots,
Alumin,
Alice,
Whirl
This is getting very long, so at @MDXF's suggestion, I'm moving the subprograms and comments to a gist. The program here is only the final program. Thanks to MDXF again for providing the TIO test driver.
##\$"404"#N#S# , ,,#$#?@\404!?@GJlICJlGCC*G^+0%=%=+0%x&fqpqqqiipsoddddoiipsohphhhhyhhhh? ?nnn4$4#!000110000011110000100000100000110000011001100000111100001110011000111000110000
#?\++++:----:++++:H@((((4O0O4O@((((()()()){}){x}x){}x()){}){}()){}){})<[-]>[-]-[<+>-----]<+x%"404"?.⌂----.++++.>11
#i(N/"404"ooo@ENTHOEONHSSEONTHOEONSETssipceaiiiiiscejiiiijeeeejapmzaeeaeueewzaeeeaeewzaeeaeueewqs??|?)999|997+|++++!999777+++++!999997+++++!
print(404)
__DATA__=1
# \"404"*CC'[-][ .-$_"404"&]
"""pp
I want 404 of this
How much is it
# -52, Z, -1 #
# -48, Y, -1 #
# -52, X, -1 #
[-][
x::=~404
::=
x
]<<<
> 404
>> Output 1
red up two blue up red up one blue up red up two blue up
baaaaa bleeeeeeeeet bleeeeeeeeet baaaaa bleeeeeeeeet
a now 404 dollar off!
a has been selling out worldwide!
2 LEFT
2 LEFT
2 UP
2 LEFT
2 TEACH
1 LEFT
1 RIGHT
1 BOND
1 BOND
1 TEACH
2 YELL
1 FIGHT
2 YELL
1 TEACH
2 YELL
set ! 52
set ! 48
set ! 52
+------+
|$0011\|
|/000\0|
|0/0@11|
|00 10|
|0\10/0|
|\1100/|
+------+
$'main'
\-444o000o444omm^
[-][$++++++++++++++++++++++++++++++++++++++++++++++++++++.----.++++.#
<<<<<<```>>>>.>.>.
]
ss"""
#7777777777777777777777777777724091557093543643404➡77▲▲▲²²▲²²¡▼▼▼▼¡▲▲▲▲¡⠎⡆⡎⡆⢐⠣⠃s&&&&~-<<:<<:<<<:<:>>>>>>>>:^||||G<>
Try it online!
Whirl is described as a Turning Tarpit [sic], which uses only two instructions, 1 and 0. 1 rotates the current wheel of instructions (either the math wheel or the operations wheel), 0 swaps the rotation of the wheel, and two 0s executes the instruction and switches wheels. The relevant instructions are on the first line:
000110000011110000100000100000110000011001100000111100001110011000111000110000
000110000 Switch to math wheel and execute math.not (math.val = 1)
011110000 Execute math.store, (memval = math.val = 1)
10000 Execute math.add, (math.val = math.val+memval = 1+1 = 2)
010000 Execute math.store (memval = math.val = 2)
0110000 Execute math.multiply, (math.val = math.val*memval = 2*2 = 4)
01100 Execute math.store (memval=math.val) and switch to the ops ring
110000 Execute ops.one (ops.val = 1)
011110000 Executes ops.intio, printing memval (4)
11100 Add one to memory pointer (memval=0)
1100 Execute maths.nop to switch back to ops ring
011100 Execute ops.intio, printing memval (0)
01100 Execute maths.store, (memval=maths.val=4)
00 Execute maths.intio, printing memval (4)
The leading 01s cancel each other out, and the trailing 01s cause a floating point exception.
Edit: fixed a bunch of broken stuff
(Commands to be careful about in the future: UDLR%"[.]o473psjw
)
If any programs work for future languages or don't work for current or previous languages, please comment.
Can the sub program be inserted into the previous or only appended? For example 1) ><>
# ;nnn404
2) ><> and Befunge-93# ]404,,,@;nnn404
– Jo King – 2018-01-21T02:23:21.970The source code of the subprograms do not need to have any relation. They're run as separate programs – Zacharý – 2018-01-21T02:24:08.657
Bytecount of the final program or the total of every program? – Jo King – 2018-01-21T02:35:32.113
So "Working" is outputting and "Not Working" is doing anything else? – Esolanging Fruit – 2018-01-21T02:36:32.360
@JoKing, I just edited that. – Zacharý – 2018-01-21T02:36:58.937
@EsolangingFruit Yes, working is outputting 404. It's edited now – Zacharý – 2018-01-21T02:38:05.013
Is it okay if we output with a leading newline? – Esolanging Fruit – 2018-01-21T03:01:25.620
4You think anyone is going to get to 404 languages? – Jo King – 2018-01-21T03:23:28.320
1@JoKing That would be greater than the current "add a language to a polyglot" challenges, so probably not... – Esolanging Fruit – 2018-01-21T05:35:13.813
1
"The source code of the subprograms does not need to have any relation" - but they must each be a subsequence of the full (byte-count) program that runs in all N languages, right? If not could you please define "sub-program"?
– Jonathan Allan – 2018-01-21T12:24:36.017"submission" means the post, not the code. Thanks for bringing that up – Zacharý – 2018-01-21T15:15:02.023
I evidently suck at explaining things – Zacharý – 2018-01-21T17:57:27.150
I think I fixed it now, – Zacharý – 2018-01-21T18:02:06.367
@Zacharý Maybe don't talk about subprograms. Just say something like "you have to write N programs and pick N languages in a particular order. the ith program needs to print
404
in the first i languages, but not in any language after the ith". – Martin Ender – 2018-01-21T18:59:55.940To be clear, if a program prints 404 but also errors it is considered working, right? Also is any leading or trailing whitespace allowed? By the way I think this is a great challenge – dylnan – 2018-01-21T23:08:20.460
1+1 only because now I know what that crap was. I just ignored it before. Oh no, this cannot be unseen now! – sergiol – 2018-01-22T00:22:54.633
Are programs ending in infinite loops allowed? – Jo King – 2018-01-24T08:28:05.613
What do you mean, @JoKing? You mean output 404 then go into an infinite loop? I'd have to say no there – Zacharý – 2018-01-24T13:03:49.907
1@Zacharý why's that? They print 404. If trailing whitespace is OK I think that should be OK. – MD XF – 2018-01-26T04:03:16.607