-3
\$\begingroup\$

In this challenge, you will create the shortest graphical program that displays exactly "Hello, world!"

You will need no input.

You might be asking yourself, "what does he mean by graphical?" Well, by graphical, I mean not writing to stdout. For example, look at my ES6 answer, which makes an alert box pop up rather than the traditional hello world where you do write to stdout:

alert('Hello, world!')

That doesn't write to stdout. Which is what I am challenging you to do today.

Formatting

This is an example post in markdown for the ES6 snippet I posted above:

# JavaScript (ES6), 22 bytes

    alert('Hello, world!')

View an example post.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Related. Also, is this code golf? It needs some scoring criteria. Can you elaborate more on what is allowed? (eg. is it acceptable to write to stderr?) \$\endgroup\$ Commented May 15, 2022 at 21:08

3 Answers 3

7
\$\begingroup\$

Minecraft Command Blocks, 47 bytes

summon cow ~ ~ ~ {CustomName:'"Hello, world!"'}

Spawns a cow with the name Hello, world!cow with name

\$\endgroup\$
0
\$\begingroup\$

JavaScript (ES6), 22 bytes

alert('Hello, world!')

This is an example for my question.

\$\endgroup\$
1
  • \$\begingroup\$ You can save 2 bytes with alert`Hello, world!` \$\endgroup\$ Commented May 15, 2022 at 21:10
0
\$\begingroup\$

PHP (8.1), 20 bytes

echo'Hello, world!';
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Welcome to Code Golf! I'm not sure if this counts, since with, e.g., php -r (if I'm remebering the flag right) it would go to STDOUT, but this question is probably going to be closed as unclear anyway. \$\endgroup\$ Commented May 15, 2022 at 21:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.