24
4
This challenge sounds too simple to not already exist, so let me know if it is a duplicate.
The task
Print Hello, world!
The rules
Your code has to be in "byte order". This means that every character / byte has a higher or equal byte value than the preceding character / byte.
Exceptions to this rule are the whitespace characters, which may occur anywhere.
The usual loopholes are not allowed.
Edit: Using built-in functions / constants resolving to Hello, world!
is not allowed.
Edit 2: The output may be a(n anonymous) function returning the string, an expression resolving to the string, or any other way you think should be allowed.
example
HW
is valid: 0x48 (H) <= 0x57 (W)
print
is invalid: 0x72 (r) > 0x69 (i)
but PRint
is valid: 0x50 (P) <= 0x52 (R) <= 0x69 (i) <= 0x6e (n) <= 0x74 (t)
The scoring
This is code-golf so the score is the number of characters / bytes. The lower the score, the higher the ranking.
9There are many languages with 1-byte Hello World built-ins. Some may even print Hello World for an empty program. – Dennis – 2017-03-18T20:09:14.040
2Very closely related. (The difference is that that one allows each line to be sorted independently, and that it's primarily scored by the number of lines.) – Martin Ender – 2017-03-18T20:09:15.440
@Dennis Added an extra rule because of that! Thanks – Charlie – 2017-03-18T20:14:39.010
Still trivial in 23, Headsecks, and Lenguage, but much longer than a couple of bytes. – Dennis – 2017-03-18T20:29:32.093
Default output like
ans = Hello, world!
is that OK? Otherwise, MATLAB and Octave won't be able to attempt this...disp
,printf
andeval
are all in non-alphabetical order. – Stewie Griffin – 2017-03-18T20:34:00.030@StewieGriffin That is now allowed, yes – Charlie – 2017-03-18T20:41:19.837
If not for the lowercase
– Erik the Outgolfer – 2017-03-18T20:47:39.980w
, Stuck would have done it in 0 bytes, since the rules disallow builtins, but the empty program isn't using a builtin.@EriktheOutgolfer How is the empty program not a built-in? It's a builtin constant program that results in
Hello, World!
... – mbomb007 – 2017-03-22T16:07:28.810Is scoring characters or bytes? It's not clear... – mbomb007 – 2017-03-22T16:08:39.733
@mbomb007 Well, I wouldn't consider a built-in program to be the same thing as a builtin function or constant, unless used as an "eval full program" argument (not just "eval"), which seems to me pretty unlikely. – Erik the Outgolfer – 2017-03-22T17:03:43.433
@EriktheOutgolfer It's a constant. And it's part of the language. AKA a built-in. – mbomb007 – 2017-03-22T18:36:14.567