# Evolution of “Hello World!”

This contest is officially over, the winner is jimmy23013. Congratulations!

The challenge is to make a program that prints Hello World! to stdout. The catch is that your program must have a Levenshtein distance of 7 or less from the program in the answer submitted before yours.

# How This Will Work

Below I have already submitted the first answer using Python: print("Hello World!").

The next person to answer must modify the string print("Hello World!") with up to 7 single character insertions, deletions, or substitutions so that when it is run in any language that hasn't been used so far (only Python in this case) the output is still Hello World!.

For example the second answerer might use 1 substitution (r -> u), 2 deletions (in), and 1 insertion (s) to make the string puts("Hello World!") which prints Hello World! when run in Ruby.

The third person to answer must do the same thing in a new language, but using the program of the second person's answer (e.g. puts("Hello World!")) as their starting point. The fourth answer will be in relation to the third answer and so on.

This will continue on until everyone get stuck because there is no new language the last answer's program can be made to run in by only changing 7 characters. The communal goal is to see how long we can keep this up, so try not to make any obscure or unwarranted character edits (this is not a requirement however).

# Formatting

Please format your post like this:

#Answer N - [language]

[code]

[notes, explanation, observations, whatever]


Where N is the answer number (increases incrementally, N = 1, 2, 3,...).

You do not have to tell which exact characters were changed. Just make sure the Levenshtein distance is from 0 to 7.

# Rules

The key thing to understand about this challenge is that only one person can answer at a time and each answer depends on the one before it.

There should never be two answers with the same N. If two people happen to simultaneously answer for some N, the one who answered later (even if it's a few seconds difference) should graciously delete their answer.

Furthermore...

• A user may only submit one answer per 8 hour period. i.e. Each of your answers must be at least 8 hours apart. (This is to prevent users from constantly watching the question and answering as much as possible.)
• A user may not submit two answers in a row. (e.g. since I submitted answer 1 I can't do answer 2, but I could do 3.)
• Each answer must be in a different programming language.
• Different versions of the same language count as the same language.
• Languages count as distinct if they are traditionally called by two different names. (There may be some ambiguities here but don't let that ruin the contest.)
• You may only use tabs, newlines, and printable ASCII. (Newlines count as one character.)
• The output should only be Hello World! and no other characters (a leading/trailing newline is not an issue).
• If your language doesn't has stdout use whatever is commonly used for quickly outputting text (e.g. console.log or alert in JavaScript).

Please make sure your answer is valid. We don't want to realize there's a break in the chain five answers up. Invalid answers should be fixed quickly or deleted before there are additional answers.

Don't edit answers unless absolutely necessary.

# Scoring

Once things settle down, the user who submits the most (valid) answers wins. Ties go to the user with the most cumulative up-votes.

### Leaderboard: (out of date)

(user must have at least 2 valid answers)

11 Answers

7 Answers

6 Answers

5 Answers

4 Answers

3 Answers

2 Answers

### Languages used so far:

(Feel free to edit these lists if they are incorrect or out of date.)

This question works best when you sort by oldest.

NOTE: This is a trial question for a new challenge type I have in mind where each answer depends on the last and increases in difficulty. Come discuss it with us in the chatroom for this question or in meta.

• "Sort by oldest" is useful here. – xnor Oct 27 '14 at 6:39
• chatroom for discussion on this question – Justin Oct 27 '14 at 7:04
• @Mew HQ9+ prints the wrong message. But this one... esolangs.org/wiki/Huby – Sp3000 Oct 27 '14 at 13:55
• Maybe this can be interesting : migl.io/projects/hw. This list automatically the answers and display their life time. – Michael M. Oct 27 '14 at 15:00
• @gerrit Cause I could really use 350 more answer notifications... – Calvin's Hobbies Nov 4 '14 at 1:39

# Answer 85 - GDB (GNU Debugger)

#[]([.]c;main()&alert"  "
echo Hello World!
#[;]:;#bye;dnl</vsh>


I think this can also be qualified as a programming language. It has even if and while commands.

echo is another built in command in GDB.

To run this code:

gdb --batch -x file


Distance: 7 from answer 84.

• Please revision your answer, the 85 was an invalid answer (I didn't notice the language had been used before) and I deleted it. – Nit Oct 29 '14 at 11:09
• Any link to GDB ? – Optimizer Oct 29 '14 at 11:10
• @Optimizer gnu.org/software/gdb The Gnu Debugger. – jimmy23013 Oct 29 '14 at 11:11
• Its like running java project in Eclipse rather than Netbeans – Optimizer Oct 29 '14 at 11:15
• This answer is fine. GDB has a command language which is used to execute specific debug commands. This is done by running GDB in batch mode and specifying the command file using --batch -x <file>. This is a legit language. See here: sourceware.org/gdb/onlinedocs/gdb/Mode-Options.html (-batch flag) – user4768 Oct 29 '14 at 11:25

# Answer 1 - Python

print("Hello World!")


There's got to be dozens of languages this could morph into.

• Why is this being up-voted but not the question? I guarantee you the question was harder to write ;) – Calvin's Hobbies Oct 27 '14 at 7:13
• Why is your comment being up-voted more than your answer? – tomsmeding Oct 27 '14 at 10:49
• @Calvin'sHobbies Answer upvotes are worth more, you shouldn't complain :-) – Angew is no longer proud of SO Oct 27 '14 at 12:20
• @tom Why is your comment being up-voted more than this answer? – nicael Oct 30 '14 at 17:39
• ^ All of them regretting that there are no rep awarded for comment upvotes! – Optimizer Nov 1 '14 at 21:26

## Answer 59 - HTML

What? No HTML ??

<echo o[.]c;cat<<;#&&alert" ">Hello World!</vsh

Distance from Answer 58 : 6

Voodoo Magic ? Nah. Here is how it works:

You can have any arbitrary tag in HTML, so the first part <echo o[.]c;cat<<;#&&alert" "> is an echo tag, which now becomes a blank tag with no CSS applied by default by the browser.

The o[.]c;cat<<;#&&alert" " part is actually two properties set on that tag separated by space. So the first property has the key o[.]c;cat<<;#&&alert" and second key is " and both the values are blank.

Second part is just plain text Hello World! which is the text contents of the echo tag.

Next up, HTML tries to find the closing echo tag, but instead, finds a closing vsh tag. It then ignores the closing vsh tag (i.e. </vsh) and auto closes the echo tag.

• @MAKZ HTML is pretty free and loose. You can have unmatched opening closing tags and what not. XHTML is pretty strict. w3schools is a good starting point. – Optimizer Oct 28 '14 at 7:30
• You can have any tag in HTML, so echo is a normal tag. o[.]c;cat<<;#&&alert" is a property on that tag and the last " is another property on that tag. You can see this using Inspector developer tool too. – Optimizer Oct 28 '14 at 7:38
• Pretty dang clever. Never would have thought of it. – RubberDuck Oct 28 '14 at 13:33
• I think this is what happens when you read standards documents at 3 am while on peyote. – David Conrad Oct 31 '14 at 17:13
• @Optimizer Required reading for people recommending w3schools. ;) – Martin Ender Dec 18 '14 at 15:00

# Answer 95 - C

//[]([.]c;
main()    {
puts("Hello World!");}
//#[;]#bye;dnl</>


Distance 7 from answer 94

• Bloody finally. – Nit Oct 29 '14 at 20:18
• @Optimizer I didn't get any kind of runtime error using gcc 4.7.2 on my computer. – archaephyrryx Oct 29 '14 at 20:21
• @Emil Just vim auto-indentation; OP's call on what to do about this (if it progresses too far to fix, you can just pretend that it's a tab and make the distance 7) – archaephyrryx Oct 29 '14 at 20:31
• @user23013 Because the program doesn't specify int as the return type for main and doesn't actually return an exit code; therefore, the return code is technically undefined behavior, hence the 13. – Qix - MONICA WAS MISTREATED Nov 5 '14 at 0:33
• Some of the previous answers (starting from 85 GDB) did extra work to prepare for C. – kernigh Nov 21 '14 at 20:27

# Answer 22 - LOLCODE

VISIBLE "Hello World!"


Distance : 6

• Looks like distance 6 to me - delete p, ut -> VI, tr -> IB, n -> E – isaacg Oct 27 '14 at 9:58
• Thanks. I think I copied different code while calculating distance. – Snack Oct 27 '14 at 9:59

# Answer 151 - Java

//#
class jux{public static void main(String[] h){System.out.println(//;\#//Hello*}}print,
"Hello World!");}}//print"putsx;//-##[;]#bye</>%"


Distance from Answer 150 : 7

Try it here

(Thanks to Christopher Creutzig for being such a sport :) )

• Now for the C# answer! – rodolphito Nov 5 '14 at 1:31

# Answer 10 - GNU dc

[puts "\x48][Hello World!]p


Distance: 6

• Well this is hard. Haha. – Mark Gabriel Oct 27 '14 at 7:51
• @MarkGabriel Hint: Substring. – jimmy23013 Oct 27 '14 at 8:10

# Answer 4 - Pyth

"Hello World!


This answer is a distance of 6 from the previous answer. Pyth strings do not need a closing quote if they are at the end of a line.

• Darn, I had a good one for the previous. – Justin Oct 27 '14 at 6:36

# Answer 11 - Golfscript

#[puts "\x48]
"Hello World!"


A distance of 5.

## Answer 83 - Markdown

What ?? No Markdown ? :P

[](#[.]c;cat;#&&alert"  "
@echo)Hello World!
[;]:;#bye;dnl</vsh>


Try it here

Distance from Answer 82 : 7

e   -> [
:   -> ]
\n  -> (
o H -> o)H
:   -> [
#   -> ]
"   -> :


Voodoo magic ?? Nah!! Here is how it works:

• [text](link) creates a link.

So the first part of the code is

[](#[.]c;cat;#&&alert"  "
@echo)


Which creates an empty text link with location

#[.]c;cat;#&&alert"  "
@echo

• Next part Hello World! is printed as is

• Then [;]:;#bye;dnl</vsh> creates a reference link for ; which can be used anywhere in the markdown.

Ex:

[Some text][;] // Outputs a link with text "Some text" and url ";#bye;dnl</vsh>"

• It's getting questionable whether that's a programming language. (Same for HTML actually.) – Martin Ender Oct 29 '14 at 10:01
• Well, If HTML is a language, Markdown is too. Its the same relation between JS and Closure. Also, given this challenge (1 lang per ans), these rules ought to be loosened a bit. – Optimizer Oct 29 '14 at 10:03
• As I said, I don't think HTML is a programming language either by our standards. But for the purpose of this particular challenge it's probably fine to loosen those rules (but ideally Calvin's Hobbies should state that). – Martin Ender Oct 29 '14 at 10:04
• Can we have this discussion somewhere else rather than on my answer ? :) – Optimizer Oct 29 '14 at 10:52
• Still pretty impressive – Fabinout Oct 31 '14 at 9:17

# Answer 15 - Sage

print("Hello World!")


Distance = 6

Full circle.

# Answer 12 - Mathematica

#[puts];
"Hello World!"


Distance of 7. Attempting to clear up some of that mess.

# Answer 6 - Befunge 98

<@,kb"Hello World!"


Distance of 5 from the previous answer. There was originally a bug where the k wasn't there; I know it was there when I wrote this program, though. I guess it just didn't make it into this post.

• I should have inflated this, but oh well. – Justin Oct 27 '14 at 6:43
• I'm just going to post answer 7 based on the inflated version... – jimmy23013 Oct 27 '14 at 6:44
• @Quincunx I can't imagine us ever being able to get up to System.out.println... – Sp3000 Oct 27 '14 at 6:52
• @Sp3000 We can firstly write the Java program in a comment. Then turn everything else into a comment. – jimmy23013 Oct 27 '14 at 6:56
• I had considered allowing multiple responses per answer so it could branch out like a tree. Then you guys could go on your little Java tangent. That would be way too confusing though... – Calvin's Hobbies Oct 27 '14 at 7:02

## Answer 2 – CJam

"Hello World!"


This is a distance of 7 from the first answer

Try it online here

# Answer 19 - VHDL

report "Hello World!";


Distance: 6

• wow :) ........ stubborn huh? – MAKZ Oct 27 '14 at 9:43
• Haha, I've been waiting for a code golf question that allows me to use an HDL :p – user4768 Oct 27 '14 at 9:46

# Answer 23 - APL

 "Hello World!"


Note there's a leading space.
Distance: 7

• the W must be capitalized to print "Hello World!". – user32377 Oct 27 '14 at 10:18

# Answer 3 – PHP

<?="Hello World!"?>


This answer is a distance 5 from the second answer.

• Please note that the string "Hello World!" verbatim, which is obviously distance 0 from answer 2, is a valid PHP program outputting the required string, and explicit print statement is unnecessary. – hijarian Oct 28 '14 at 11:55
• @hijarian: That's only true for the PHP shell, which makes it invalid for this challenge. – Dennis Oct 28 '14 at 21:02
• @Dennis If you write a script helloworld.php, and put the 12 symbols Hello World! in there and then you run this script with php helloworld.php, you'll get Hello World! printed to stdout as PHP treat everything outside of <?php ?> processing instruction as raw text to output. – hijarian Oct 29 '14 at 4:30
• I have realized that you'll need to remove quotation marks (which makes it Levenstein distance 2) to be fully compliant. – hijarian Oct 29 '14 at 4:30
• @Petah So? This is not code golf. We are not supposed to make it as short or as easy to continue as possible. – PurkkaKoodari Oct 31 '14 at 8:04

## Answer 28 - J

]trace=:('Hello World!')


Distance = 5 from Answer 27

• ] + = + : + ' + ' = 5, right? – user32377 Oct 27 '14 at 10:37
• Sure. Missed it being quick... This type of question surely adds a real time feeling to code challenges :P. – jpjacobs Oct 27 '14 at 10:40
• one of the oddest notations for a language with such a simple name... – CodeManX Nov 5 '14 at 2:15
• And J could have been answer 2, by deleting the print and replacing the double with single quotes, ending up with ('Hello World!'). – bcsb1001 Dec 21 '14 at 17:10

## Answer 33 - Extended BF Type III

a#="*#[.>]trac": "@Hello World!


Distance 7 from Answer 32

Well, I have not found an interpreter for that extension but the code seems to fit the specs of the language.

a //ignored
#="*# //comment
[.>] //print each character until an empty cell
trac" //ignored
: //move pointer, do not impact result
" //ignored
@ //end of source
Hello World! //Injected in cells before execution

• Just so you know, the above answer is invalid as it has a distance of 8. That should be fixable by removing some spaces though, so you might want to fix yours after the other guy does. – Scimonster Oct 27 '14 at 12:26
• It's corrected. My apologies. – RubberDuck Oct 27 '14 at 12:29
• My answer is also fixed. – Michael M. Oct 27 '14 at 12:30
• I got a neat one lined up for this, can't wait for the 8-hour timer. – Nit Oct 27 '14 at 14:04

# Answer 5 - Perl

print"Hello World!"


This answer is a distance 6 from the fourth answer.

# Answer 7 - Bash

echo Hello World!


This is a distance of 7 from the sixth answer.

• A lame distance zero from here would be Batch.... Quick @RandomUserViewingThisComment, go post it! – Justin Oct 27 '14 at 6:59
• @Quincunx Distance 1 with the @ character. – jimmy23013 Oct 27 '14 at 7:01
• @user23013 Good point; I'm very poorly acquainted with Batch.... But it would work in commandline. – Justin Oct 27 '14 at 7:03
• @Quincunx Or it will print \nX:\Your\Working\Directory>echo Hello World!\nHello World! in a script. Or I should mean \r\n for \n. – jimmy23013 Oct 27 '14 at 7:08
• @user23013 Oh, that makes sense. – Justin Oct 27 '14 at 7:11

# Answer 8 - Nimrod

echo "\x48ello World!"


Distance of 6 from the last answer.

• There's not supposed to be a comma. – feersum Oct 27 '14 at 7:04

# Answer 14 - Lua

#[put
print("Hello World!")


Distance = 7

• Aaand we're back to the start, good job. – Nit Oct 27 '14 at 9:04
• hi @Timmy, I'm sorry but I had to change my answer from print to cat. – Mark Gabriel Oct 27 '14 at 9:04

# Answer 21 - Haskell

putStrLn "Hello World!"


Distance: 7

• Am I the only one who thinks Haskell's version of print is dafter than LOLCODE's? – Pharap Oct 28 '14 at 8:30
• @Pharap: Haskell's version of print is called print, and it does something rather un-daft: print some value, of any¹ type – but in valid Haskell notation! So print 5 yields 5 as output, and print "Hello World!" yields "Hello World!"; but the challenge asked for Hello World, without quotation marks (which wouldn't be valid Haskell). – ceased to turn counterclockwis Oct 28 '14 at 10:43
• @Pharap ¹It doesn't actually work with any type, only with Showable types. – ceased to turn counterclockwis Oct 28 '14 at 10:45
• @leftaroundabout Well, suum cuique pulchrum est I suppose. – Pharap Oct 28 '14 at 10:52
• @ceasedtoturncounterclockwis data W=World;data H=Hello W; Hello World – Esolanging Fruit Dec 8 '17 at 4:27

## Answer 26 - TI-BASIC (NSpire)

Disp "Hello World!"


Distance: 5 from answer 25

(Tested on a TI-NSpire calculator)

• I see you have an NSpire calculator; that should be noted in the title as TI-83/84/+/SE do not have lowercase letters. – Timtech Oct 27 '14 at 11:15
• @Timtech They actually do have lowercase letters. If you have MirageOS or another custom OS, you can enable them. Here's a screenshot of a program I wrote a while ago that uses lowercase letters. – wchargin Oct 28 '14 at 19:20

# Answer 100 - AMPL

#[][.]#i
#main()    {
print("Hello World!");
#[;]#bye;dnl</>


Distance 6 from Answer 99

• WOOO. #100! Have +10 rep. – Kaz Wolfe Oct 29 '14 at 23:04

## Answer 29 - MS Windows Powershell

#]trace=:(
'Hello World!'


Distance = 3 from Answer 28

• Actually, I liked how the punk-haired smiley just appeared... =:( – agtoever Oct 28 '14 at 10:59
• From this point on, the answers accumulate junk (usually commented out). Answer 85 (GDB) added a "main", and the answers eventually reached C and then Java. – kernigh Nov 21 '14 at 22:07

# Answer 42 - FALSE

{#ah="*#[.>]trac";cat<<@
#&&alert
?} "Hello World!
"


Levenshtein distance from #41 is 7. Tested with this online implementation of FALSE. I used some leftover edit-distance slots to remove some cruft...

• I should have done some of that cruft cleaning myself, but I can't now. I'd break the chain. – TecBrat Oct 28 '14 at 15:00
• random upvote for being answer 42 - the answer is false :P – CodeManX Nov 5 '14 at 2:24

# Answer 150 - MuPAD

//#class jux{public static void main(String[] h){System.out.println(;\#//Hello*}}print,
"Hello World!"//print"putsx;//-##[;]#bye</>%"


Distance 6 from answer 149.

EDIT: Added “ h” to move the chain forward.

• Ah... If you could have just put an h after the String[], next answer would have been in Java ;) – Optimizer Nov 4 '14 at 15:45
• In the interest of getting a long chain, I guess I'll just cheat and edit that in right now. ;-) – Christopher Creutzig Nov 4 '14 at 15:47

# Answer 30 - K

/#]trac
"Hello World!"


Distance: 7 from Answer 29

I think this works, an interpreter is here (Kona). / begins a one-line comment in K. I've cleaned up some of the #]trace=:( mess.