28
1
Write a program that takes no input and prints Hello, World!
to stdout or your language's closest alternative. The catch is that each line in your program must only contain printable ASCII characters and it must be in lexicographical order, a.k.a. sorted.
Here are all 95 printable ASCII characters in order:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
So, for example, the line !!A0~
would be invalid because the A
and 0
are out of order. The line !!0A~
would be valid.
Each line in your program may be any length and there may be any number of lines. Empty lines are considered sorted. Each of the newlines in your program must be the same (no mixing \n
and \r\n
). Tabs and other non-printable ASCII characters are forbidden.
Due to popular demand, the win condition has been switched around:
The submission with the fewest lines wins. Tiebreaker goes to the shortest program (newlines count as single characters).
Only Hello, World!
and an optional trailing newline should be output. Note that HQ9+ is invalid since it outputs hello, world
. I may forbid languages similar to HQ9+ that have one character "Hello, World!" commands due to their triviality.
Hint:
This is definitely possible in Unary and Lenguage, though not very concisely.
7It's a bit late now, but somehow I feel like least lines then fewest bytes might have been more interesting... – Sp3000 – 2015-03-27T04:37:11.563
6@Sp3000 We'd need a combined measure, or else Unary and Lenguage would mean that only 1-liners could compete. – isaacg – 2015-03-27T04:44:24.293
@Sp3000 Maybe, I just wanted to make sure Unary/Lenguage weren't likely to win. I'm open to changing it though (sorry isaacg). Upvote Sp's comment if you agree. – Calvin's Hobbies – 2015-03-27T04:46:07.603
@Sp3000 I've taken your advice. See updates. – Calvin's Hobbies – 2015-03-27T06:05:17.613
Can the order be inversed? For example, reading from left-to-right? – Ismael Miguel – 2015-03-27T11:53:30.137
@IsmaelMiguel No – Calvin's Hobbies – 2015-03-27T11:55:22.473
@Calvin'sHobbies That made things dificult for me, but I managed it! – Ismael Miguel – 2015-03-27T12:22:38.820
Can you please define "or your language's closest alternative"? Does this mean if a language has a specific and different string it generally prints to show its functionality, we can do that instead? – mbomb007 – 2015-03-27T21:59:24.587
@mbomb007 The alternative is in place of stdout, not
Hello, World!
. Some languages don't really have a standard output stream (e.g. for Javascript I'd acceptalert
orconsole.log
). – Calvin's Hobbies – 2015-03-27T22:04:42.937Neither of those are sorted though. – mbomb007 – 2015-03-27T22:44:04.413
@mbomb007 I know, I was just giving a general example of an stdout alternative. – Calvin's Hobbies – 2015-03-27T22:47:15.563
This can be used for testing if your code lines are truly correctly sorted: http://ideone.com/knuIEL
– skagedal – 2015-03-30T14:38:49.337Trust me, Unary isn't going to win, because of Headsecks. – mbomb007 – 2015-03-30T16:25:12.520
Why are "Hello World!" questions so popular, when many more important questions are unsolved – bacchusbeale – 2015-04-05T09:46:30.690