235
\$\begingroup\$

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:

  1. Python
  2. CJam
  3. PHP
  4. Pyth
  5. Perl
  6. Befunge 98
  7. Bash
  8. Nimrod
  9. Ruby
  10. GNU dc
  11. Golfscript
  12. Mathematica
  13. R
  14. Lua
  15. Sage
  16. Julia
  17. Scilab
  18. JavaScript
  19. VHDL
  20. HyperTalk
  21. Haskell
  22. LOLCODE
  23. APL
  24. M30W
  25. Stata
  26. TI-BASIC (NSpire)
  27. ActionScript 2
  28. J
  29. PowerShell
  30. K
  31. Visual FoxPro
  32. VBA
  33. Extended BF Type III
  34. Zsh
  35. Dash
  36. Clojure
  37. NetLogo
  38. Groovy
  39. CoffeeScript
  40. Clipper
  41. B.A.S.I.C.
  42. FALSE
  43. fish (shell)
  44. GNU Octave
  45. TCL
  46. E
  47. newLisp
  48. Lisp
  49. SMT-LIBv2
  50. Racket
  51. Batsh
  52. tcsh
  53. AppleScript
  54. Mouse
  55. Pixie
  56. F#
  57. Falcon
  58. Burlesque
  59. HTML
  60. SGML
  61. M4
  62. MUMPS
  63. TeX
  64. Forth
  65. Salmon
  66. Turing
  67. bc
  68. Betterave
  69. Scheme
  70. Emacs Lisp
  71. Logo
  72. AutoLISP
  73. ///
  74. Rebol
  75. Maple
  76. FreeBASIC
  77. Vimscript
  78. ksh
  79. Hack
  80. mIRC
  81. Batch
  82. Make
  83. Markdown
  84. sh
  85. GDB
  86. csh
  87. HQ9+-
  88. Postscript
  89. Matlab
  90. Oz
  91. CASIO BASIC
  92. VBScript
  93. QBasic
  94. Processing
  95. C
  96. Rust 0.13
  97. Dart
  98. Kaffeine
  99. Algoid
  100. AMPL
  101. Alore
  102. Forobj
  103. T-SQL
  104. LiveCode
  105. Euphoria
  106. SpeakEasy
  107. MediaWiki
  108. SmallBASIC
  109. REXX
  110. SQLite
  111. TPP
  112. Geom++
  113. SQL (postgres)
  114. itflabtijtslwi
  115. RegXy
  116. Opal.rb
  117. Squirrel
  118. Pawn
  119. Scala
  120. Rebmu
  121. Boo
  122. PARI/GP
  123. Red
  124. Swift
  125. BeanShell
  126. Vala
  127. Pike
  128. Suneido
  129. AWK
  130. Neko
  131. AngelScript
  132. gosu
  133. V
  134. ALAGUF
  135. BogusForth
  136. Flaming Thunder
  137. Caché ObjectScript
  138. owl
  139. Cardinal
  140. Parser
  141. Grin
  142. Kitten
  143. TwoDucks
  144. Asymptote
  145. CAT
  146. IDL
  147. Tiny
  148. WTFZOMFG
  149. Io
  150. MuPAD
  151. Java
  152. Onyx
  153. JBoss
  154. S+
  155. Hexish
  156. yash
  157. Improbable
  158. wake
  159. brat
  160. busybox built-in shell
  161. gammaplex
  162. KTurtle
  163. AGOL 68
  164. Alice
  165. SML/NJ
  166. OCaml
  167. CDuce
  168. Underload
  169. Simplex v.0.6
  170. Minkolang 0.9
  171. Fexl 7.0.3
  172. Jolf
  173. Vitsy
  174. Y
  175. Retina
  176. Codename Dragon
  177. Seriously
  178. Reng v.3.3
  179. Fuzzy Octo Guacamole
  180. 05AB1E

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

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

184 Answers 184

1 2
3
4 5
7
5
\$\begingroup\$

Answer 67 - bc

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

Distance: 7 from answer 66.

\$\endgroup\$
5
\$\begingroup\$

Answer 69 - Scheme

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

Distance of 7 with Answer 68: addition of newline, deletion of ~, newline and $, substitutions of ~ to ;, ~ to ) and # to ;

\$\endgroup\$
5
\$\begingroup\$

Answer 71 - Logo

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

Distance of 7 from Answer 70.

Online Interpreter

\$\endgroup\$
5
\$\begingroup\$

Answer 82 - Make

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

Distance 4 from Answer 81: add e \t del ; sub ?->\n
Tested on Ubuntu

\$\endgroup\$
1
  • 2
    \$\begingroup\$ There is a literal tab before the @echo. (Stack Exchange stupidly converts tabs to spaces.) \$\endgroup\$
    – kernigh
    Nov 21, 2014 at 20:17
5
\$\begingroup\$

Answer 87 - HQ9+-

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

Distance 7 from answer 86.

Unlike Hello, H9+, HQ9+ and HQ9++, H9Q+- actually prints Hello World!. The creator's website clearly says so, and it offers an interpreter (standard untar-make approach) which I have tested.

\$\endgroup\$
7
  • 2
    \$\begingroup\$ "eco" - I see what you did there. ;) \$\endgroup\$
    – alexia
    Oct 29, 2014 at 13:23
  • 2
    \$\begingroup\$ We seem to be using a rather loose definition of programming language here, but for the record, H9+ derivatives are not programming languages. \$\endgroup\$ Oct 29, 2014 at 13:28
  • 5
    \$\begingroup\$ We should really fix our definition of programming language. Rules like detecting prime numbers, taking input and manipulating it to output etc are somewhat baised imo. To me, this PPCG is an SE where esolangs are honored the most and esolangs can have any kind of rules. some might not even have the concept of integers, forget determining prime numbers. \$\endgroup\$
    – Optimizer
    Oct 29, 2014 at 13:40
  • \$\begingroup\$ @MartinBüttner: That definition seems to exclude a lot of interesting languages, such as Deadfish x. \$\endgroup\$
    – Dennis
    Oct 29, 2014 at 13:42
  • \$\begingroup\$ @Optimizer Regex and /// don't have the concept of numbers either and still fulfil that definition. Feel free to post your own definition as an answer to that question. \$\endgroup\$ Oct 29, 2014 at 13:43
5
\$\begingroup\$

Answer 102 - Forobj

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

Distance 7 from Answer 101. (added ""%d""%)

An interpreter does not, in fact, exist. However, the code is fairly straightforward. It pushes a big string, then pops it ("..."%). It then pushes the string "Hello World!" and prints it (d). Lastly, it pushes another string and pops that one as well.

\$\endgroup\$
4
  • \$\begingroup\$ This is invalid, you have a random percent sign that is not in quotes... \$\endgroup\$
    – Timtech
    Oct 30, 2014 at 18:59
  • \$\begingroup\$ @Timtech Yes; why does that make this invalid? \$\endgroup\$
    – Doorknob
    Oct 30, 2014 at 19:00
  • \$\begingroup\$ It appears that multi-line strings aren't supported in forobj \$\endgroup\$
    – Timtech
    Oct 30, 2014 at 19:12
  • \$\begingroup\$ @Timtech What makes you think that? Forobj does support multiline strings, to my knowledge. \$\endgroup\$
    – Doorknob
    Oct 30, 2014 at 19:15
5
\$\begingroup\$

Answer 162 - KTurtle

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

Distance 6 from Answer 161

\$\endgroup\$
4
\$\begingroup\$

Answer 35 - Dash

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

Distance 3 from answer 34.

\$\endgroup\$
1
  • \$\begingroup\$ At this point, we have answers in bash, zsh, and dash. I reckon bash and dash to be dialects of the same Bourne shell language (zsh is more different), but bash and dash do count as two languages under the "different names" rule, and bash has many more features than dash. \$\endgroup\$
    – kernigh
    Nov 21, 2014 at 19:57
4
\$\begingroup\$

Answer 38 - Groovy

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

7 distance from 37

Try it here

\$\endgroup\$
4
\$\begingroup\$

Answer 39 - CoffeeScript

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

6 distance from 38

Try it here

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I am skeptical about having both JS and CS :P \$\endgroup\$
    – Optimizer
    Oct 27, 2014 at 17:16
  • \$\begingroup\$ Could be, but this one uses different syntax than the JS one :P \$\endgroup\$
    – BrunoJ
    Oct 27, 2014 at 17:17
  • \$\begingroup\$ That's because it had to :P \$\endgroup\$
    – Optimizer
    Oct 27, 2014 at 17:19
  • 3
    \$\begingroup\$ @Optimizer I think that it's OK because they use different syntax. \$\endgroup\$
    – Scimonster
    Oct 27, 2014 at 17:28
  • 1
    \$\begingroup\$ @Optimizer then you could also disqualify all languages compiled to binary after the first. I think that the runtime doesn't matter, because you could write a CoffeScript compiler which doesn't compile to JavaScript but to binary. Or JVM bytecode. Or C# (which would need to be compiled once more). \$\endgroup\$
    – 11684
    Oct 31, 2014 at 21:10
4
\$\begingroup\$

Answer 37 - NetLogo

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

Distance 5 from from Answer 36

\$\endgroup\$
4
\$\begingroup\$

Answer 44 - GNU Octave

#ah="*#[.>]trac";cat<<
#&&alert 
disp "Hello World!"

Levenshtein distance from #43: 5 (1 removed, 4 replaced)

\$\endgroup\$
4
\$\begingroup\$

Answer 47 - newLisp

;#ah="*#[.>]trac";cat<<
;#&&alert 
(print "Hello World!");\

distance = 7

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

Answer 49 - SMT-LIBv2

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

Distance = 5

\$\endgroup\$
4
\$\begingroup\$

Answer 51 - Batsh

//echo o#[.>]tac";cat<<;#&&alert 
println("Hello World!");

Distance = 7

\$\endgroup\$
4
\$\begingroup\$

Answer 53 - Applescript

#//echo o[.>]tac;cat<<;#&&alert (printf
log"Hello World!"

Distance 6 from answer 52

\$\endgroup\$
1
  • \$\begingroup\$ I knew AppleScript had -- comments but not # comments. Seems that AppleScript added # comments in AppleScript 2.0. \$\endgroup\$
    – kernigh
    Nov 21, 2014 at 20:02
4
\$\begingroup\$

Answer 56 - F#

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

7 distance from 55

Try it here

\$\endgroup\$
4
\$\begingroup\$

Answer 77 - Vimscript

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

Distance 7 from Answer 76

\$\endgroup\$
4
\$\begingroup\$

Answer 80 - mIRC script

;?hh #[.]c;cat;#&&alert"  "
echo  Hello World!
;#";#bye;dnl</vsh>

Distance 7 from Answer 79: 1 comment marker (;), 6 removals ($e=""~).

\$\endgroup\$
4
\$\begingroup\$

Answer 81 - Microsoft Batch

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

Distance 7 from Answer 80: 3 additions, 4 cleanup.

Tested in Windows 7.

\$\endgroup\$
4
\$\begingroup\$

Answer 90 - Oz

%#[]([.]c;main()
   {Show 'Hello World!'}
%#[;]:;#bye;dnl</>

Distance: 6 to answer 89

\$\endgroup\$
1
  • 10
    \$\begingroup\$ Let's keep up the flow and continue aiming for C \$\endgroup\$
    – Optimizer
    Oct 29, 2014 at 14:01
4
\$\begingroup\$

Answer 108 - SmallBASIC

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

Distance 7 from Answer 107 (I could do it in 4, but I spent the rest on getting rid of unnecessary fluff like that annoying tab from the Makefile.)

Yes, SmallBASIC does not require closing strings.

\$\endgroup\$
1
  • \$\begingroup\$ For a second I thought it was the other Small Basic. Was slightly disappointed. Great answer nonetheless! \$\endgroup\$
    – user23597
    Oct 6, 2015 at 11:16
4
\$\begingroup\$

Answer 124 - Swift

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

Distance 7 from answer 123.

\$\endgroup\$
7
  • \$\begingroup\$ I have a good one derived from answer 121 but... \$\endgroup\$
    – jimmy23013
    Oct 31, 2014 at 20:41
  • 2
    \$\begingroup\$ Please continue the flow towards Java only. \$\endgroup\$
    – Optimizer
    Nov 1, 2014 at 5:27
  • \$\begingroup\$ @Optimizer But only if I can find more languages... \$\endgroup\$
    – jimmy23013
    Nov 1, 2014 at 5:33
  • \$\begingroup\$ @Optimizer While I think collusion to make matters more "fun" is an idea among those who want to, the challenge isn't to get to Java (a language people already know) but to introduce a wide variety of ideas and have fun. Moreover, that's not how evolution works...and although I like to argue on the merits of intelligent design, Java is not that (in my book). \$\endgroup\$ Nov 1, 2014 at 5:48
  • 1
    \$\begingroup\$ @Dr.Rebmu - Challenge is not to get wide variety of languages. But to tackle the fact that things will start becoming more and more complex. Amongst that complexity, getting a language which requires so much syntax is awesomeness. \$\endgroup\$
    – Optimizer
    Nov 1, 2014 at 5:50
4
\$\begingroup\$

Answer 125 - BeanShell

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

Distance from Answer 124 : 7

Trying to move towards Java

\$\endgroup\$
4
\$\begingroup\$

Answer 129 - AWK

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

Distance from Answer 128 : 7

Run it online here

\$\endgroup\$
2
  • \$\begingroup\$ Well Pascal is no longer likely to be possible now... \$\endgroup\$
    – jimmy23013
    Nov 1, 2014 at 18:09
  • 1
    \$\begingroup\$ Oh! I tried with BEGIN, but it was 1 char too much :( \$\endgroup\$
    – Optimizer
    Nov 1, 2014 at 19:11
4
\$\begingroup\$

Answer 157 - Improbable

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

Distance from Answer 156 : 7

Everything

  • in # ... # is a comment
  • in ` ... ` is output to STDOUT
  • after ; is ignored as program has exited
\$\endgroup\$
4
\$\begingroup\$

Answer 158 - wake

#B00class jux{public static void main(String[] h){#
#System.Cont.Wrintln(//;\//Hello*}}print,cat<<<
:"Hello World!"#` ;}}//print#putsx;//-##[;]#bye</>%"

Distance 5.

\$\endgroup\$
4
\$\begingroup\$

Answer 164 - Alice

(*#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 163

\$\endgroup\$
4
\$\begingroup\$

Answer 165 - SML/NJ

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

Distance 2 from Answer 164

This could be any SML dialect, including Alice — but answer 164 isn't valid SML: only Alice allows an unterminated comment.

(MLton is now within reach.)

\$\endgroup\$
4
\$\begingroup\$

Answer 166 - OCaml

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

Distance 7 from Answer 165

\$\endgroup\$
4
  • 2
    \$\begingroup\$ So, is OCaml the final submission? \$\endgroup\$
    – Vi.
    Dec 4, 2014 at 21:30
  • \$\begingroup\$ Yes, I'm finally marking this answer as this official end of the contest. Amazing job everyone! \$\endgroup\$ Jan 4, 2015 at 8:01
  • \$\begingroup\$ @Calvin'sHobbies Can I make a new submission? \$\endgroup\$
    – Def
    Jan 9, 2015 at 16:06
  • \$\begingroup\$ @Deformyer Sure. Feel free to keep it going if possible. \$\endgroup\$ Jan 9, 2015 at 17:29
1 2
3
4 5
7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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