# 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

#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

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).

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.

(user must have at least 2 valid 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

/<vsh  o[.]c;cat;#&&alert"  "
(princ//Hello World!/);%!#bye";dnl</vsh>~


println("Hello World!")

• Which answer 15 have you used? – Beta Decay Oct 27 '14 at 9:21
• @BetaDecay I had linked to it, but I've changed it now that the C one was deleted. – Martin Ender Oct 27 '14 at 9:22

alert("Hello World!");


Lev. Dist from A#17 = 5

• awww, so close! you beat me by 15 secs :( – user4768 Oct 27 '14 at 9:31
• @Stacey maybe.... – MAKZ Oct 27 '14 at 9:32
• An alert window isn't stdout...? – zamnuts Oct 27 '14 at 18:59
• @zamnuts It is commonly accepted on PPCG to use alert in Javascript as it has no real stdout. – Ingo Bürk Oct 27 '14 at 19:01
• @zamnuts console.log has nothing to do with stdout. It's a debug tool. Again, this is commonly accepted here. We shouldn't litter the comments of this answer with this discussion; feel free to start a discussion on meta about it (if it doesn't exist yet). – Ingo Bürk Oct 27 '14 at 19:05

display "Hello World!"


Distance: 6 ([-> ", ]-> ", and addition of di and pl)

Heck, if HTML counts…

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


Distance from Answer 59 : 7

• I remember learning that HTML was SGML. This isn't true today; HTML syntax is not SGML syntax (html.spec.whatwg.org/multipage/syntax.html#parsing), so HTML is not SGML. – kernigh Nov 21 '14 at 20:08
• @kernigh, I know. I was merely saying that if HTML counts sufficiently as a language to post an answer in it (see the preceding answer, #59), then why not SGML. – msh210 Nov 23 '14 at 0:08

say [Hello World!]


Distance: 5

• the W must be capitalized to print "Hello World!". – user32377 Oct 27 '14 at 10:18
• Typo, thanks for pointing it out. – Scimonster Oct 27 '14 at 10:21
• Well, now I know why I've never heard of M30W. +1 – Pharap Oct 28 '14 at 8:33

## Answer 27 - ActionScript 2

trace("Hello World!")


Distance: 7 (Disp -> trac = 4, +e( = 2, +) = 1 = 4+2+1 = 7)

• Why 2? This is ActionScript 1. – Pierre Arlaud Oct 28 '14 at 8:58
• I used to program in AS2. I did so in flash, on the timeline. There I can have a single line of code. Then I moved to AS3, and I've been using document classes ever since. I wasn't sure whether one can use a single line of code like this in ActionScript 3, so I labelled it AS2. – user32377 Oct 28 '14 at 9:02

;ah="*#[.>]trac":;cat<<@
(pr"Hello World!"
)


; makes the rest of the line a comment, and (pr "Hello World!") does the printing

• Love the use of the commenting – sydan Feb 13 '15 at 11:51

#{//-##[][/]#i--#main(){println(
#//sel/.*}}
print("Hello World!")
#;//"-##[;]#bye</>%"


Happy Halloween!

Distance 7 from Answer 120. Nothing fancy: added three # comment characters, and added rint after p.

Boo has syntax inspired by Python, but is a separate language with unique features built on the .NET CLI.

• What happened to answer 120? – Hosch250 Oct 31 '14 at 17:19
• @hosch250 seemed to just be a typo, it was relative to 120 and linked, just mislabeled. Edited – Dr. Rebmu Oct 31 '14 at 17:21
• OK, I thought that might be the problem. – Hosch250 Oct 31 '14 at 17:25
• I meant to complete it like Boo Yeah! – Optimizer Oct 31 '14 at 17:43
• Appropriate language given today's date. – Amory Oct 31 '14 at 21:47

puts "\x48ello World!"


Distance: 4

#[puts];
cat("Hello World!")


Distance = 5

answer "Hello World!"


Distance: 7

# Answer 31 - Visual FoxPro

*#]trac
? "Hello World!"


Not tested of course, but * begins a comment and ? "String" prints String.

• How on earth have you ever come across and vFox? Well done/sorry :-)! – Ben Oct 27 '14 at 22:20
• @Ben By browsing the list of "hello world" examples on Wikipedia and looking for short ones ;) – Doorknob Oct 27 '14 at 23:55

## Answer 70 - Emacs Lisp

;dnl<vsh  o[.]c;cat;#&&alert" ">w ".in
(print "Hello World!") ;%!#bye";dnl</vsh>~


Distance of 7 from Answer 69. Didn't need any changes to compile, but cleans up a bit.

• I would've cleaned up some of the odd things like 'dnl<vsh' instead of the common comment characters. – agweber Oct 28 '14 at 15:12
• @agweber why make things too easy? :P – resueman Oct 28 '14 at 15:16
• @resueman Because in the question it was stated that the goal was to make the chain as long as possible. – 11684 Oct 31 '14 at 21:17

# Answer 107 - MediaWiki markup

{|--#[][.]#i--#main()   {puts(,
Hello World!
|--#[;]#bye;dnl</>"%


There is already HTML, SGML and Markdown. Why not MediaWiki?

You can see it here.

• Note: The spaces after main() is a tab (introduced for Makefile). I didn't change it. – jimmy23013 Oct 30 '14 at 6:47
• Someone should get rid of it ... – Optimizer Oct 30 '14 at 9:49

a="*#]trac":? "Hello World!"


Runs from the immediate window. The colon : is a line sepator that allows multiple lines of code to be written on the same line. (Anything run from the immediate window has to be a one liner.) The ? is a shortcut for printing to the immediate window.

• I count more than 5: a = " is already 5, and then there is ": and the newline transformed into a space. – plannapus Oct 27 '14 at 12:22
• You might want to dump the spaces, because right now it's 8. – Scimonster Oct 27 '14 at 12:26
• Shoot. I forgot to remove the extra space and there is already another answer @Scimonster. – RubberDuck Oct 27 '14 at 12:27
• I left a comment on the other answer notifying them so they can fix it after you do. – Scimonster Oct 27 '14 at 12:28
• I like how you introduced a variable. More "programmatic" solution than just commenting some things out. – agtoever Oct 28 '14 at 11:02

(*#class jux{public static void main(String[] h){#
#System.Console.Writeln(//@\//Hello*}}print,cat<<#*)
print "Hello World!"(*)#X ;}}//printputsx;//-##E;]bye</>%#*)


Distance 7 from Answer 166, removed _string

Nothing special, most difficult part was finding the language.

(* *) makes a multiline comment, print prints the string

disp("Hello World!")


Distance = 6 to Answer 16

• I'm way late, but this won't work: MATLAB uses single quotes for strings, not double quotes... that might have derailed the whole train :( – Dang Khoa Oct 27 '14 at 23:47
• I haven't tried running it, but changing this to Scilab might fix it – Sp3000 Oct 27 '14 at 23:58
• @DangKhoa Aww, that's too bad. But it's fixed now. – Calvin's Hobbies Oct 27 '14 at 23:59
• sorry for the clumsiness, and thanks for the fix! – titus.andronicus Oct 28 '14 at 8:18

;@echo o#[.>]tac";cat<<;#&&alert
(print "Hello World!");\


Distance is 7 from the previous answer. Needs to be run in the shell.

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


Distance: 6

%#[]([.]c;main()
/eco (Hello World!)=
%#[;]:;#bye;dnl</>


Distance: 6 insertions to answer 87.

Back to real programming languages.

# Answer 96 - Rust 0.13

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


• I was sluggishly monitoring this for "C" answer to finally appear in order to try Rusting it... – Vi. Oct 29 '14 at 21:08

{//-##[][/]#i--#main(){println(
//sel/.*}}
p("Hello World!")
;//"-##[;]#bye</>%"


• { and } are asymmetric string delimiters for an alternate representation of strings permitting balanced nested pairs, embedded quotes, etc. {Hey {it's} "legal"}. Add one at the beginning then two braces to create a balanced string after the .* cost 3

• Standalone string literals not passed to any function are skipped by the evaluator, so that literal has no effect.

• At the outset of the program, P is a single character abbreviation for PR, itself an abbreviation for PRINT. (If you wanted you could overwrite it and use as a variable in code golf and still access printing through PR, and if you overwrite that you could use PRINT. Or set X to point to the function value of P before you override it, etc.) cost 1

• Parentheses are structural elements that can be used for arbitrary purposes (imagine if Lisp had [] and () as different "flavors" of series you could metaprogram with, with [] having the traditional "list" behavior). In the default evaluator parens just do precedence, so there's no significance to putting it around a string literal. Added a paren instead of subtracting in case it would be helpful, either way it's cost 1

• Semicolon comments to end of line, get rid of last line using that with an insertion so that the comment comes after it. (Would have been 1 cheaper to do that with the first 2 lines but this is perhaps a better setup.) cost 1

• Spend extra random character to join println onto main(){ cost 1

(*#class jux{public static void main(String[] h){#
#System.Console.Writeln(//@\//Hello*}}print,cat<<#*)
pint)(Hello World!)S(#X ;}}//printputsx;//-##E;]bye</>%#*)


ah="*#[.>]trac":;<<@
Hello World!
@


Since I can't craft the solution I wanted to go with from the previous one, here's another solution instead:

*#//;ah="*#[.>]trac":;cat<<@
? "Hello World!"


NB: There is a trailing space at the end of line 2.
Distance: 6

Clipper is unique in that it has four different commenting techniques of which I've used two above:

* A comment
// A comment
&& A comment
/* A multiline
comment */


? is obviously the print command.

;@echo o#[.>]trac";cat<<
(princ "Hello World!");\


Distance = 7

• Is that supposed to be princ? – TRiG Oct 27 '14 at 23:09
• @TRiG It's not a typo. stackoverflow.com/questions/19756296/… – Nit Oct 27 '14 at 23:17
• This doesn't say which Lisp. I guess this was meant to be Common Lisp. – kernigh Nov 21 '14 at 20:00

~//echo o[.>]c;cat<<;#&&alert (printf
"Hello World!"\$


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


Distance from Answer 60 : 7

%;dnl<vsh  o[.]c;cat;#&&alert" ">w "
Hello World!\bye";dnl</vsh>


• I'm not quite convinced whether this is valid, as the OP said you can use another output format if the language doesn't have stdout. Technically, there's \typeout in TeX (no pun intended). – nyuszika7h Oct 29 '14 at 13:19
• @nyuszika7h: At least my version of TeX (3.1415926 (TeX Live 2014/dev)) doesn't seem to have \typeout. It works in LaTeX, which came with the same package. – Dennis Oct 29 '14 at 13:31