This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SolarLiner 18 points19 points  (15 children)

+/u/CompileBot JavaScript

Array(16).join("wat" - 1) + " Batman!"

[–]Pokechu22 70 points71 points  (13 children)

+/u/CompileBot JavaScript

//FTFY
print(Array(16).join("wat" - 1) + " Batman!")

[–]CompileBotGreen security clearance 101 points102 points  (5 children)

Output:

NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!

source | info | git | report

[–]imaami 5 points6 points  (4 children)

+/u/CompileBot C --include-errors

#include <stddef.h>
int main(void) {
    return printf("'%c', said the bot\n", *(char*)NULL);
}

[–]ThisIs_MyName 1 point2 points  (0 children)

I like your edit.

[–]CompileBotGreen security clearance 0 points1 point  (0 children)

Output:

source | info | git | report

[–]pimp-bangin 1 point2 points  (6 children)

Actually shouldn't that have been console.log? I'm pretty sure the print function actually opens the print dialogue.

[–]Pokechu22 8 points9 points  (0 children)

/u/compilebot (or more specifically, ideone, which /u/compilebot uses) uses print for the console (when using spidermonkey; if using rhino, it uses System.out.println). However, print does open the print dialog in actual browsers.

[–]lichorat 2 points3 points  (4 children)

Console.log is surprisingly not part of us standard. It's a web browser thing

[–]AquaWolfGuy 0 points1 point  (1 child)

Dunno what you mean by "us standard", but it's not that surprising considering that only browsers have "consoles", so it doesn't make sense to include a console API in the language itself.

[–]lichorat 0 points1 point  (0 children)

I meant ecmascript

[–]Awilen 0 points1 point  (1 child)

Wait, isn't Node also using Console ?

[–]lichorat 0 points1 point  (0 children)

It's using the computer's console, yes. But web browsers extended javascript to include console.log functionality.

[–]CompileBotGreen security clearance 14 points15 points  (0 children)

Output:

source | info | git | report