404 - Unique 404 page not found

26

4

Inspired by a polyglot on the Stack Overflow 404 page:

Goal

Your goal is simple, to create a polyglot that outputs the number 404, and then terminate, in as many languages as possible.

Restrictions

Here's the twist, there's a restriction to make it harder:

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. This is to prevent very simple solutions from destroying competition

Scoring:

  • The first criterion for determining a winner is the number of languages the main program runs in.
  • The second criterion is byte count, where the programs with more languages have more importance for this criterion.
  • The third and final criterion is time of submission

Clarifications:

The source codes of the programs do not need to have any relation. They're run as separate programs. Any of the programs can output trailing and/or leading whitespace. THE PROGRAMS DO NOT HAVE TO BE SUBSEQUENCES OF EACH OTHER!

Thanks to @MartinEnder for a better explanation!

Zacharý

Posted 2018-01-21T01:54:05.660

Reputation: 5 710

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.970

The 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.940

To 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

Answers

27

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.

54. Whirl

##\$"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.

Jo King

Posted 2018-01-21T01:54:05.660

Reputation: 38 234

@Zacharý RE: my comment under the OP - at some stages this has ...print(0 or 404) but it is not a subsequence of the 97 byte N-program. – Jonathan Allan – 2018-01-21T12:26:12.467

@JonathanAllan yeah, I was a little concerned about that too. Sub-program does imply they are related to the final program, but I’m going off the question specs here – Jo King – 2018-01-21T12:57:55.863

No, you're not going off question specs. "Submission" meant the entire post, not the code. – Zacharý – 2018-01-21T15:16:59.887

I think I fixed the specs now – Zacharý – 2018-01-21T18:05:07.303

Hey it won't work in brain-flak, # is comment – Christopher – 2018-01-22T19:32:41.450

Oh brain-hack :P – Christopher – 2018-01-22T19:47:29.577

You should be able to add Actually if you can stick . after the "404" and then before any other .s. – Mego – 2018-01-23T13:35:38.470

1@Mego Done. Was a little harder than suggested, but it all worked out – Jo King – 2018-01-23T21:26:49.060

1

I think you should be able to add TinCan. @MDXF too. I can't because Jelly and M won't allow any line to begin with #. I'm really regretting including those two languages haha.

– dylnan – 2018-01-24T01:31:44.897

35, wow this got ridiculous fast – Zacharý – 2018-01-24T13:04:56.777

If you can add #hell with two characters mad props

– dylnan – 2018-01-24T22:55:24.430

Turning Tarpit ... LOLOL – Zacharý – 2018-01-28T20:28:59.490

16

53 languages, 2789 bytes

Bash, Foo, Implicit, Charcoal, Emoji, ><>, rk, Brain-Flak, C, Set, Cood, Arcyou, TRANSCRIPT, S.I.L.O.S, Commercial, C++, Braille, Deadfish~, Memescript 1.0, ETA, Python 1, Python 3, PARI/GP, Lily, Fission, Decimal, Cubically, Bitwise, TinCan, Whispers, Thue, Emotinomicon, what??!, Ook!, evil, Lennyfuck, Blablafuck, Stones, TacO, COW, Symbolic Brainfuck, Underload, Rail, Reticular, Gaot++, PATH, axo, Monkeys, Nhohnhehr, xEec, VTFF, K-on Fuck, Churro, and Forked. Try everything online in the test driver!

Join us in the chatroom for this challenge!


This post got way too large so here's a gist containing my progress. Current final program:

Forked

#undef l" 404"p;((((\)0)0)0)0;(4⏬0⏬4⏬«404»[:5*11-1/1]%&)(404)S^/*NNNNTNNEONHSSEONTHOEONiisoddddoiisohOok! 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. ????!?!!?!??!!!???????????????!?!!!?!????!??????????????!!??!??!??!????!⎚404»404➡ to for the and of to to to to to is the and  a to to to to a and and and and a ;n4n0n4
#11404D301          \4%0%p%&
""""echo 404|| rk:start int x = 404 print: x rk:end R"404"*
exit;
#;
OUT &52 &1
OUT &48 &1
OUT &52 &1 */
#include<stdio.h>
main(){char aA[]={37,100,0};printf(aA,404);}/*<<<<<mzaeeeaeeaaaawuuuuwaaaa what the frick frack backtrack snick snack tic tac snick snack patty wack diddily dack tic tac diddily dack frick frack quarterback frick frack
x::=~404
::=
x #
set ! 52
#;⠎⡆⡎⡆⢐⠣⠃▲▲▲²²▲²²¡▼▼▼▼¡▲▲▲▲¡(♥ ͜ʖ♥)( ͡°((∩ ͡° ͜ʖ ͡°)⊃━☆゚.*( ͡° ͜ʖ ͡°)ᕦ( ͡°ヮ ͡°)ᕥ(♥ ͜ʖ♥)(♥ ͜ʖ♥)(♥ ͜ʖ♥)(♥ ͜ʖ♥)(♥ ͜ʖ♥)) ͡°)(∩ ͡° ͜ʖ ͡°)⊃━☆゚.*( ͡° ͜ʖ ͡°)(> ͜ʖ<)(♥ ͜ʖ♥)(♥ ͜ʖ♥)(♥ ͜ʖ♥)(♥ ͜ʖ♥)(> ͜ʖ<)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)(> ͜ʖ<)うんうんうんうんたんたんたんたんうんうんうんたんうんたんうんうんうんうんうんたんたんうんたんたんうんたんたんうんたんたんうんたんたんたんたんたんうんうんたんうんたんうんたんうんうんうんたんたんうんたんたんうんたんたんうんたんたんたんうんうんうんたんうんうんたんうんうんたんうんうんたんうんたんうんうん {o}===}{======={o}{o}}{======={o}{o}===}{======={o}
> 404
>> Output 1
I want 404 of this.
How much is it?
Ju is here.
>Ju, 404
>X Ju
b = 404
printInt b ;
set ! 48 MoOMoOMoO
set ! 52 MoOOOMmoO
+--------+
|$00110\ |
|/00001/ |
|\11000\ |
|/11000/ |
|\0100 \ |
|        | baaaaa bleeeeeeeeet
|  404p@ |
|        |
+--------+
$'main': OOMmOoOOM ;
 \-444o000o444o-{<$$^- >}+{-----v}+.----.++++.#
#  bleeeeeeeeet baaaaa ^        < bleeeeeeeeet >
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
red up two blue up red up one blue up red up two blue up ;
o now 404 dollars off!
o has been selling out worldwide!
#  -52, Z, -1                          #
#  -48, Y, -1                          #
#  -52, X, -1                          #
⡆⡎⡆⢐⠣⠃((((p 404)((()(((()()()){}){}){}){}){}){}){}) h#4 o# h#0 o# h#4 o# """
print(404)#"*/

Try it online!

My new (-ly implemented) esolang!

MD XF

Posted 2018-01-21T01:54:05.660

Reputation: 11 605

what the frick frack paddy wack (give the dog a bone) is that language? (congratz on passing me) – Jo King – 2018-01-23T05:33:09.267

@JoKing honestly I have no idea what was going through my head when I made that language.... also thanks for the help with Braille and Deadfish~, I hope you don't mind that I used your code? – MD XF – 2018-01-23T05:57:41.267

no worries mate – Jo King – 2018-01-23T06:02:07.420

MDXF v. Dylnan, I see. – Zacharý – 2018-01-24T03:10:22.543

2@Zacharý MD XF v Dylnan v Jo King; every time I pull ahead, I fall asleep and then have to go to school and by the time I get back on they both are ahead again, building off my languages and each others'... sigh – MD XF – 2018-01-24T03:11:58.220

this is my last day of work for the week, so you bet i'll be catching up! – Jo King – 2018-01-24T03:14:39.277

If we get our own site design, the winner definitely goes on the 404. – Zacharý – 2018-01-24T04:10:47.650

@Zacharý will you also accept the winner? (I'm going to try as hard as I can to win and I've never had one of my answers accepted before) – MD XF – 2018-01-24T04:11:26.193

I will eventually, but when the updating slows down – Zacharý – 2018-01-24T04:22:02.210

@Zacharý yeah wait at least a week – MD XF – 2018-01-24T04:24:27.627

I didn't see that you'd already done Cood, but you can get rid of the Hey waiter! part, and the ending punctuation on the other two lines. Try it online!

– Jo King – 2018-01-24T10:33:20.827

Normal brainfuck no longer works. It prints a bunch of null characters, 4044 and enters an infinite loop (lol can't post TIO link because too long) – Jo King – 2018-01-25T05:05:43.237

Braille is broken now. I checked because it had been broken on mine since I added Symbolic BF. @JoKing somehow your program works for both Braille and Symbolic BF. Should we start a chat room for this challenge? I don't know how to do it – dylnan – 2018-01-25T18:46:21.580

@JoKing I can't fix it, I just removed Brainfuck. – MD XF – 2018-01-25T18:48:22.317

13

34 Languages, 387 characters

Jelly, M, Pyon, Proton, Python 3, Python 2, Python 1, Perl 6, Perl 5, Ruby, bc, Pari/GP, brainfuck, Emoji, Emotinmicon, Charcoal, Braingolf, Whitespace, Deadfish~, Deadfish, Self-modifying Brainfuck, Symbolic Brainfuck, Numberwang, Cardinal, Actually, Fission, Prelude, Brain-Flak (BrainHack), Alphuck, Deadfish x, TacO, Braille, rk, evil

This answer is getting very long so here is the full answer. From now on only the last program will be kept here.

If anyone finds that one of the programs is broken for one language or one program works for a language it shouldn't, let me know.

print(404)   	  
+1#<[-]>--[<+>-----]"404".⌂<+.----.++++.404➡⎚404»___pppissiiiisiiiio▲▲▲²²▲²²¡▼▼▼▼¡▲▲▲▲¡sipceaiiiiiscejiiiijeeeejaxxcxxxcxxxKddddKcxxxx7777777724091557093543643%R"404";77999++++++++!++++++++6+1+!++++++5++++!> @p404 sp7 rk:start print: "404"77szaeeaeueewzaeeeaeewzaeeaeueew
   	  
+1#((a(()a((()(((()()())a{})a{})a{})a{})a{})a{})a{})	
 		
 		
 	


+1#ṛ“Nạç»⠎⡆⡎⡆⢐⠣⠃

Try it online!

dylnan

Posted 2018-01-21T01:54:05.660

Reputation: 4 993

Wow, congrats, you've just blown everyone else out of the water. – MD XF – 2018-01-22T01:56:07.850

@MDXF Thanks! I'm planning on doing more I just have to stop for now. – dylnan – 2018-01-22T02:18:22.747

If only the Julia versions were different enough I could've beaten you by 10 bytes with this sigh

– MD XF – 2018-01-22T05:32:35.763

@MDXF Someone did post a double Julia answer to the Trick or Treat polyglot question exploiting some bug but it got deleted and I don't remember what it was – dylnan – 2018-01-22T06:51:12.907

@dynlan well I can see deleted posts so I'll go check it out, thanks! – MD XF – 2018-01-22T20:51:28.890

Brainbash prints some stuff before the 404. How about this?

– Jo King – 2018-01-23T05:05:42.280

@JoKing which program does it print stuff before 404? – dylnan – 2018-01-23T05:08:31.053

Nooo I had just passed you again :( – MD XF – 2018-01-23T05:08:51.857

@MDXF Haha sorry! I am having so much fun with this challenge – dylnan – 2018-01-23T05:09:52.223

Brainbash for the last two (i'm at work, so I can't add any more languages right now. you guys are catching up fast) – Jo King – 2018-01-23T05:10:24.057

@JoKing It isn't for me... Do you have a link where it does that? Your suggestion is shorter anyway, do you mind if I use it? – dylnan – 2018-01-23T05:13:44.927

@dylnan haha me too (passed you again btw) :P – MD XF – 2018-01-23T05:16:03.280

@JoKing This is the second to last for brainbash and this is the last for brainbash. They are both printing 404. Maybe I'm misunderstanding what you're saying

– dylnan – 2018-01-23T05:23:57.650

I see three boxes in the output. Maybe your browser isn't displaying the unprintable characters? (i'm on chrome) It prints hex bytes 9A 96 9A, cell values 154, 150, 154 – Jo King – 2018-01-23T05:26:13.247

@JoKing I'm also on Chrome. Checked on my computer and phone and it works on both. Maybe a third person can check – dylnan – 2018-01-23T05:29:54.287

@JoKing Weird that we aren't seeing the same thing. The program you gave prints 4041 for braingolf unfortunately – dylnan – 2018-01-23T06:10:46.643

in the brainbash link I got some weird chars and then 404

– FantaC – 2018-01-24T02:59:56.673

You can use * to destroy the atom in Fission if you need to – Jo King – 2018-01-24T03:09:42.730

Fission works for the Cardinal addition. I think an R just snuck in there too early – Jo King – 2018-01-24T19:38:24.757

@JoKing Oops, thanks. I think that happened when I was fixing Numberwang. – dylnan – 2018-01-24T19:40:21.430

11

11 languages, 10 bytes

Pyon

print(404

Pyon, Python 2

print 808//2

Pyon, Python 2, Python 1

print None or 404

Pyon, Python 2, Python 1, Python 3

die=0
print(die or 404);

Pyon, Python 2, Python 1, Python 3, Lua

print(None or 404)

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5

print(404 or 0)

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5, Ruby

;print("40"+"4")

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5, Ruby, Swift 4

print("40"+"4")

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5, Ruby, Swift 4, Perl 6

print(404**1)

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5, Ruby, Swift 4, Perl 6, Julia

print(404);

Pyon, Python 2, Python 1, Python 3, Lua, Perl 5, Ruby, Swift 4, Perl 6, Julia, Lily

print(404)

MD XF

Posted 2018-01-21T01:54:05.660

Reputation: 11 605

Nice. Very clean and simple answer and it still has plenty of languages – dylnan – 2018-01-22T06:49:29.123

6

4 Languages: CJam, Python, Underload, ><>

The following works in CJam but not Python, Underload, or ><>:

404
  • To CJam: This pushes the literal 404 to the stack. The program ends, and the 404 is output.
  • To Python: This program consists of a single expression 404. The expression is evaluated, and the program terminates.
  • To Underload: 4 and 0 are invalid commands, so the TIO interpreter simply ignores them, and the program terminates.
  • To ><>: 404 pushes 4, 0 and 4 to the stack. The IP wraps around to the beginning, and the program repeats infinitely.

The following works in CJam or Underload (though it errors) but not Python or ><>:

N(404)S;(\
  • To CJam: N pushes a string (array of characters) containing a newline to the stack. ( pops the single character (a newline) out of the string. 404 pushes 404 to the stack, and then ) increments it to give 405. S; pushes a spaces and then immediately deletes it. ( decrements again to get 404, and then \ swaps the newline and the 404. 404\n is output (the empty array is displayed as nothing).
  • To Underload: N is ignored. (404) pushes the string 404 to the stack. S outputs it. ; is ignored. ( causes the interpreter to try to look for a closing ), but as none is found, the program segfaults.
  • To Python: This is invalid syntax (the expression N(404) is followed by an identifier S, which is malformed), so the program errors.
  • To ><>: N is an invalid instruction, so the program errors.

The following works in CJam (though it errors), Underload, or Python, but not ><>:

[]
Le=404
+Le#(404)S
(print(404))
  • To CJam: [] pushes the empty array to the stack, and L pushes the empty array to the stack. e= counts the number of occurrences of [] in [], giving 0. 404 pushes 404 to the stack. + adds the two numbers together, giving 404. L pushes the empty array to the stack again, and e# creates a comment that lasts until the end of the line. ( tries to pop an element out of an array, but since the top stack element is the empty array [], the program errors. 404 is still output.
  • To Python: [] is a statement consisting of a no-op instruction. Le=404 defines a variable Le to be equal to 404. +Le takes the unary plus of the variable Le (a rather useless operation) and the result is discarded. #(404)S is a line comment. (print(404)) prints 404.
  • To Underload: The only relevant part is (404)S, which pushes 404 to the stack and outputs it. (print(404)) pushes print(404) to the stack, but nothing is done with it and the program terminates.
  • To ><>: [ tries to pop a number off the top stack on the metastack, and then pop that many elements off that stack and make them into a new stack which is then pushed to the metastack. There is no number on the stack, so the program errors.

The following works in CJam (though it errors), Python, Underload, and ><>:

"404nnn;\
"
Le=404
+Le#(404)S
(print(404))
  • To CJam: Most of what I said last time applies here. Instead of being [], we now have a string literal, but the content is still unimportant.
  • To Python: Most of what I said last time applies here. Instead of being [], the unused first expression is now a string literal, but the content is still unimportant.
  • To Underload: Everything I said last time applies here. All of the commands are still ignored.
  • To ><>: The " begins string mode, and the IP wraps around the first row pushing every character code it sees to the stack (this is unimportant). The IP wraps around and hits " again, which exits string mode. 404 pushes the digits 404 to the stack, and then nnn outputs each of them (technically, this happens in reverse order, but since 404 is a palindrome this doesn't matter). ; ends the program.

Esolanging Fruit

Posted 2018-01-21T01:54:05.660

Reputation: 13 542

4

6 Languages Brain-Hack, Brain-Flak, Brain-Fuck, Foo, Javascript, Alphuck

More to come!

Brain-Hack

#(((()((()(((()()()){}){}){}){}){}){}){})

Prints 404 in Brain-Hack

Brain-Hack, Brain-Flak

(((()((()(((()()()){}){}){}){}){}){}){})

Brain-Hack, Brain-Flak, Brain-Fuck

(((()((()(((()()()){}){}){}){}){}){}){})#-[<+>-----]<+.----.++++.>-.++++.

Uses comments in Brain-Flak to print it

Brain-Hack, Brain-Flak, Brain-Fuck, Foo

"404"
(((()((()(((()()()){}){}){}){}){}){}){})#-[<+>-----]<+.----.++++.>-.++++.

Brain-Hack, Brain-Flak, Brain-Fuck, Foo, Javascript

console.log("404")
//(((()((()(((()()()){}){}){}){}){}){}){})#-[<+>-----]<+.----.++++.>-.++++.

Brain-Hack, Brain-Flak, Brain-Fuck, Foo, Javascript, Alphuck

console.log("404")
//(((()((()(((()()()){}){}){}){}){}){}){})#-[<+>-----]<+.----.++++.>-.++++.iaipiiiiiaecsaejiiiijeeeej

Christopher

Posted 2018-01-21T01:54:05.660

Reputation: 3 428

Did i mention i use esolangs? – Christopher – 2018-01-22T19:42:35.593

Umm, your original Brainfuck code prints 4... – MD XF – 2018-01-29T18:32:29.267

@MDXF fixed that lol – Christopher – 2018-01-29T18:41:03.730

Now the brainfuck has alot of extra code. – MD XF – 2018-02-01T03:03:36.510

3

5 languages (87 bytes)

Pyon

print(404

Try it online!

Python 2

print(404)

Try it online!

Brain-Flak (BrainHack)

print(404)#(((()((()(((()()()){}){}){}){}){}){}){})

Try it online!

brainfuck

Taken from Jo King's answer because I wasn't able to come up with a brainfuck code that had the brackets balanced (Brain-flak restriction).

print(404)#(((()((()(((()()()){}){}){}){}){}){}){})-[<+>-----]<+.----.++++.>

Try it online!

05AB1E

Note that this also works with Ohm.

#404q
print(404)#(((()((()(((()()()){}){}){}){}){}){}){})-[<+>-----]<+.----.++++.>

Try it online!

Thanks to Jo King for -6 bytes.

Mr. Xcoder

Posted 2018-01-21T01:54:05.660

Reputation: 39 774

The x%x and [-] aren’t necessary – Jo King – 2018-01-22T20:34:11.017

@JoKing Oh whoops I forgot to remove them after adapting your brainfuck code >_<. Edited. Thanks – Mr. Xcoder – 2018-01-22T20:34:38.487

You can easily add Python 1: https://gist.github.com/anonymous/77ed24162c35aae0a10e4e1cada8547a

– MD XF – 2018-01-26T04:54:16.670

@MDXF That seems invalid to me. 1) The Python 1 version doesn’t work in Pyon 2) The Python 1 version also works in Python 2, which is forbidden. – Mr. Xcoder – 2018-01-26T05:26:03.927

@Mr.Xcoder Oh, I forgot that the non-parenthesis syntax works in Python 2. – MD XF – 2018-01-26T05:47:02.797

1

2 Languages, 24 bytes, Python and Batch

Program 1: Python 3

print('404')

Program 2: Python 3 and Batch

print('404')#|echo 404

After the the hash comments the rest of the code in python, and the | is a statement in bash to do this if the other command fails.

Mercury Platinum

Posted 2018-01-21T01:54:05.660

Reputation: 161

0

2 Languages, 53 bytes: C and Python

Let's start things off with something simple.

Program 1: C

int main(){printf("404");}

Program 2: C and Python

#define print(X)int main(){printf("404");}
print(404)

TIO links:

This is just an example, and will probably be beaten many times over.

Zacharý

Posted 2018-01-21T01:54:05.660

Reputation: 5 710

0

4 languages, 91 bytes

C++

#ifdef __cplusplus
#include "stdio.h"
int main(){printf("%d",404);}
#endif

C++, C

#include "stdio.h"
int main(){printf("%d",404);}

Removes the C++ macro

C++, C, Befunge

#define A "404",,,@
#include "stdio.h"
int main(){printf("%d",404);}

Adds a macro that will be ignored in C++, but read as code in Befunge.

C++, C, Befunge, Python

#define A "404",,,@
#include "stdio.h"//\
print(404);'''
int main(){printf("%d",404);}//'''

Ads a piece of code that causes the next line to be a comment in C, but not in Python (//<backslash>)

Zacharý

Posted 2018-01-21T01:54:05.660

Reputation: 5 710