34
\$\begingroup\$

This is a repost of Evolution of “Hello World!”, originally written by user Helka Homba

It should not be closed as a duplicated, due to meta consensus here.

The original was asked over two years ago and was last active more than six months ago. I have permission from Helka Homba to post this here

Since the original, many languages have been invented, and many people have joined the site who have never had an opportunity to answer the original, so I feel that this repost is acceptable.


The challenge is to make a program that prints 2^n to stdout, where n is the number of your program. The catch is that your program must have a Levenshtein distance of 10 or less from the program in the answer submitted before yours.

How This Will Work

Below I will submit the first answer using C#, which prints 2^(n=1)=2.

The next person to answer must modify the code with up to 10 single character insertions, deletions, or substitutions so that when it is run in the language of the new answer, it prints 2^n (with n being the answer number). For example, the 25th answer (let's say it's in Pyth) would print 2^25, or 33554432.

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

If you answer in some language or the resulting code is just a mess, do please explain what you did and why it works, though this isn't required.

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 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.)
  • Try to avoid posting too many answers in a short time frame.
  • Each answer must be in a different programming language.
    • You may use different major versions of a language, like Python 2/3
    • 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 do not have to stick to ASCII, you can use any characters you want. Levenshtein distance will be measured in unicode characters.
  • The output should only be 2^n and no other characters. (Leading/trailing whitespace is fine, as is unsuppressible output like >>> or ans=)
  • If your language doesn't have stdout use whatever is commonly used for quickly outputting text (e.g. console.log or alert in JavaScript).
  • When the power of two you have to output gets very large, you may assume infinite memory, but not an infinite integer size. Please be wary of integer overflows.
  • You may make use of scientific notation or whatever your languages most natural way of representing numbers is. (Except for unary, DO NOT output in unary)

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.

Edit these when you post an answer:

Leaderboard

13 languages

Okx

8 languages

zeppelin

4 languages

Pavel
Jonathan Allan
Kritixi Lithos
Riker

3 languages

boboquack

2 languages

bmarks
Conor O'Brien
Destructible Watermelon
ovs
Tom Carpenter

1 language

ATaco
Blocks
Dennis
dzaima
Erik the Outgolfer
ETHproductions
ghosts_in_the_code
Leo
Lynn
Matheus Avellar
Nathaniel
Qwerp-Derp
R. Kap
Taylor Scott
nimi
Mistah Figgins
PidgeyUsedGust
steenbergh

Languages used so far:

  1. C# (Pavel)
  2. /// (boboquack)
  3. Retina (Dennis)
  4. Jelly (Jonathon Allan)
  5. Pyth (boboquack)
  6. ><> (Destructible Watermelon)
  7. Minkolang (Kritixi Lithos)
  8. Perl (Pavel)
  9. Python (Qwerp-Derp)
  10. dc (R. Kap)
  11. Charcoal (Jonathon Allan)
  12. Self Modifying BrainFuck (Leo)
  13. SOGL (dzaima)
  14. ShapeScript (Jonathon Allan)
  15. Pyke (boboquack)
  16. Ruby (Nathaniel)
  17. 05AB1E (ovs)
  18. STATA (bmarks)
  19. bc (Kritixi Lithos)
  20. Japt (Okx)
  21. 2sable (Kritixi Lithos)
  22. Cheddar (Jonathon Allan)
  23. Pylons (Okx)
  24. Bash (zeppelin)
  25. Pushy (Okx)
  26. CJam (Erik the Outgolfer)
  27. MATL (Okx)
  28. MATLAB (Tom Carpenter)
  29. Octave (Kritixi Lithos)
  30. R (ovs)
  31. JavaScript ES7 (Tom Carpenter)
  32. Convex (Okx)
  33. Mathematica (ghosts_in_the_code)
  34. Pip (Okx)
  35. Stacked (Conor O'Brien)
  36. GolfScript (Okx)
  37. Actually (Lynn)
  38. RProgN (Okx)
  39. Scheme (bmarks)
  40. Element (Okx)
  41. J (Blocks)
  42. Cubix (ETHproductions)
  43. zsh (zeppelin)
  44. VBA (Taylor Scott)
  45. Fish (zeppelin)
  46. Reticular (Okx)
  47. Perl 6 (Pavel)
  48. RProgN2 (ATaco)
  49. PHP (Matheus Avellar)
  50. Jolf (Conor O'Brien)
  51. Haskell (nimi)
  52. Befunge-98 (Mistah Figgins)
  53. Gnuplot (zeppelin)
  54. QBIC (steenbergh)
  55. FOG (Riker)
  56. Qwerty-RPN (Okx)
  57. Korn Shell (ksh) (zeppelin)
  58. Julia (Riker)
  59. Python 3 (Pavel)
  60. Vimscript (Riker)
  61. Dash (zeppelin)
  62. Vitsy (Okx)
  63. csh (zeppelin)
  64. Ohm (Okx)
  65. Bosh (zeppelin)
  66. es-shell (Riker)
  67. Gol><> (PidgeyUsedGust)

This question works best when you sort by oldest.

\$\endgroup\$
  • 2
    \$\begingroup\$ A snippet would really be nice \$\endgroup\$ – Cows quack Feb 26 '17 at 6:58
  • \$\begingroup\$ @KritixiLithos I don't know how to do those, feel free to edit one in though! \$\endgroup\$ – Pavel Feb 26 '17 at 6:59
  • 1
    \$\begingroup\$ @TomCarpenter that is acceptable, I'm going to make the edit. \$\endgroup\$ – Pavel Feb 26 '17 at 18:53
  • 1
    \$\begingroup\$ Does "Levenshtein distance will be measured in UTF-8 characters" mean that the edit distance is computed between strings of Unicode codepoints (and the "UTF-8" is a red herring, since in this sense it doesn't matter whether you use UTF-8, UTF-16, UCS4 or something else)? \$\endgroup\$ – Sami Liedes Feb 27 '17 at 17:19
  • 1
    \$\begingroup\$ @SamiLiedes pavel responded in chat, it's just unicode codepoints yeah. (i.e. if the code point is different, it's a character difference) \$\endgroup\$ – Rɪᴋᴇʀ Feb 28 '17 at 23:17

68 Answers 68

5
+100
\$\begingroup\$

Answer 64, Ohm, distance 10

64º,;S)1'a"bc"<<x
2^63 
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ 
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added 64º,;S)1'a

Only the 64º, is actual code, the rest is just junk.

This program will print the correct output, but it will also ask for some STDIN after it has printed 264.

\$\endgroup\$
  • \$\begingroup\$ How in the world has this gone on? Nice job. \$\endgroup\$ – David Archibald Apr 17 '17 at 4:54
5
\$\begingroup\$

Answer 17: 05AB1E, Distance of 3

#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#β”6904”±r«"$2 
puts 16384 8*

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Well done on exploiting the fact the 05AB1E doesn't throw errors. \$\endgroup\$ – Okx Feb 26 '17 at 11:32
5
\$\begingroup\$

Answer 24: Bash, distance 8

#23#2ej
printf $[2**24]
#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2 
#puts 16384 8*di 2^18o8*'

Try It Online !

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

Answer 51, Haskell, distance 10

--2@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024
print(2^51)--;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Remove 2 NL, replace ^ at the beginning with -, prepend another -, delete * within the print, replace 2nd * with ^, overwrite 49with 51, insert -- after the print.

\$\endgroup\$
  • \$\begingroup\$ You removed the newlines...i cri evry tim \$\endgroup\$ – Pavel Feb 27 '17 at 3:53
  • \$\begingroup\$ seriously why did you remove the newlines \$\endgroup\$ – Destructible Lemon Feb 27 '17 at 3:53
  • \$\begingroup\$ Because haskell comments are --, so it's a lower edit distance than prepending -- twice. \$\endgroup\$ – Pavel Feb 27 '17 at 3:54
  • \$\begingroup\$ @DestructibleWatermelon: line comment -- is 2 bytes, removing NL just 1 \$\endgroup\$ – nimi Feb 27 '17 at 3:54
5
\$\begingroup\$

Answer 67, Gol><>, distance 6

We van use the trampoline # to just append the code in reverse. By removing S)1'a the ; can be reused, needing only 6 characters to be added.

#64º,;n*:"C"
"bc"<<x
2^66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ 
quit()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py 
p
riker
i
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#

Try it online!

I think keeping the # allows for some other languages to use it as a commented line.

\$\endgroup\$
  • \$\begingroup\$ Just FWIW, if a bounty is given for the last answer your answer probably won't get it. The general winner of answer chaining challenges is either the last answerer that remains last for 1-2 wks, or the person with the most answers. \$\endgroup\$ – Rɪᴋᴇʀ Mar 14 '17 at 14:16
  • 1
    \$\begingroup\$ Don't really care for the bounty — just thought it'd be a shame to let this die. \$\endgroup\$ – PidgeyUsedGust Mar 14 '17 at 16:14
4
\$\begingroup\$

Answer 4: Jelly distance 3

/class HelloWorld {static void Main() 0{
    System.Console.Write(2);
0}}//4|
8Ḥ

Try it online!

all insertions: 00Ḥ.

0{ and 0} are there to suppress parsing errors (pop from empty list due to the { and } being quicks that turn monads into dyads using the left and right argument respectively).

"unhalves" 8 to make 16.

\$\endgroup\$
  • 1
    \$\begingroup\$ Why does the first { (after class HelloWorld) not need a 0 before it, but the other two do? \$\endgroup\$ – Pavel Feb 26 '17 at 6:28
  • \$\begingroup\$ Each line is parsed as a link (function) before anything runs, the final one being the entry point to the program. The parser would be fine without the () before the second open brace on the first line. The third line cannot start with a brace as there is no monad on which to act. \$\endgroup\$ – Jonathan Allan Feb 26 '17 at 6:36
4
\$\begingroup\$

Answer 5: Pyth

32 "/class HelloWorld {static void Main() 0{
    System.Console.Write(2);
0}}//4|
8Ḥ

Prints the numeric literal 32, then the space between the 2 and the " suppresses printing of the (auto-completed) string literal.

+4 characters - 32 "

Try it on herokuapp

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

Answer 6 - ><>

32""/class HelloWorld {static void Main() 0{;n***~
    System.Console.Write(2);
0}}//4|
8Ḥ

replaced a space with ", the code pushes 3, 2, 4, then reverses, pushes 4,2,3, then pops 3 off the stack, and multiplies 2, 4, 4, 2, for 64, outputs it and halts

Try it online

maybe use https://www.fishlanguage.com/playground

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

Answer 3: Retina, distance 3

/class HelloWorld {static void Main() {
    System.Console.Write(2);
}}//4|
8

Appended |\n8 (distance 3).

Try it online!

\$\endgroup\$
3
\$\begingroup\$

Answer 20: Japt, distance 8

2**20$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2 
#puts 16384 8*di 2^18*/

Try it online!

Modifications:

Changed 2^19 to 2**20 at the start of the program, to calculate the power (4)

Replaced # with $ on the first line so that everything past it is interpreted as JS (1)

On the last line, removed the / and added a */ at the end of the program, so the comment takes up the whole program (3)

\$\endgroup\$
  • \$\begingroup\$ Sorry, my answer above was incorrect. The last digit should be 8 instead of 7. \$\endgroup\$ – bmarks Feb 26 '17 at 9:35
  • \$\begingroup\$ @bmarks Thanks, edited. \$\endgroup\$ – Okx Feb 26 '17 at 9:35
3
\$\begingroup\$

Answer 27: MATL, distance 4

27W%2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!

Added 27W%

Explanation:

  W   2 to the power of
27    27
   %  Start of single line comment
\$\endgroup\$
3
\$\begingroup\$

Answer 50: Jolf, distance 10

^2@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**49);#0}}//4|
#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it here!

Prepended ^2@2( (+5)

Removed ± and ß from #ß6904±r (+2)

Removed ó from óout (+1)

Removed <? from <?#"#28@P2* (+2)

Total: 10. Remove all the non-ASCII characters!

Explanation

( stops parsing, so the code looks like:

^2@2
^      exponentiate
 2     two
  @2   to the 50 (char code of 2)
\$\endgroup\$
3
\$\begingroup\$

Answer 52. Befunge-98, distance 8 + 2

Thanks to @DestructibleWatermelon for golfing a byte!

--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024
print(2^51)--;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it Online!

Added '3k before the 2, and '2k*. between the 2 and @.

-- does nothing,
'3k2 puts 52 2s onto the stack, and
'2k*.@ multiplies them together, prints the number, and exits

Also, I added a d" after printf("% to make other people's lives easier, as I had 2 extra characters. It doesn't affect the Befunge-98 program.

\$\endgroup\$
3
\$\begingroup\$

Answer 42: Cubix, distance 8

2^41 NB.`(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!

The lert(2**31 in the middle was changed to 44******O@.

\$\endgroup\$
3
\$\begingroup\$

Answer 60, Vimscript, distance 10

"bc<<<2^57 #x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Changed the 2 # on the start of the middle two lines to ", added a " in front of the first line, and :py<space> in front of the last line.

For clarification:

" is a line comment in vimscript (at least at the start of a line), and doesn't need to be matched.

Vim can run python code, so this is really equivalent to asking python for the answer.

\$\endgroup\$
  • \$\begingroup\$ If this is running Python code, why doesn't this error, like everywhere? \$\endgroup\$ – Pavel Feb 27 '17 at 19:27
  • \$\begingroup\$ @Pavel only the last line is run as python code. \$\endgroup\$ – Rɪᴋᴇʀ Feb 27 '17 at 19:27
  • \$\begingroup\$ Sorry, made that comment before you fixed it. \$\endgroup\$ – Pavel Feb 27 '17 at 19:29
3
\$\begingroup\$

Answer 8: Perl

#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
print(256);
#0}}//4|
#8Ḥ

Exactly distance of 10: +4 # for comments, +1 newline after System.Console., +3 for transforming write into print, +2 for turning 2 into 256.

I wasn't going to participate, but I wanted to make sure some regular langs were added before anything got too insane.

Try it online!

\$\endgroup\$
3
\$\begingroup\$

Answer 49: PHP, distance 6

<?#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**49);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added <? and ?> to open and close PHP tags, respectively.

Replaced 48 with 49.

# starts a comment on PHP, so nothing is considered except for

<? print(2**49); ?>

Here's a screenshot of proper syntax highlihgting and output to help visualize:

screenshot

\$\endgroup\$
2
\$\begingroup\$

Answer 2: ///

/class HelloWorld {static void Main() {
    System.Console.Write(2);
}}//4

+4 chars - ///4

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Regarding the answer you deleted: I changed the 8 hour requirement to a more subjective "Just try not to post too much". Feel free to undelete. \$\endgroup\$ – Pavel Feb 26 '17 at 6:47
  • \$\begingroup\$ @Pavel I want to post another answer again! :P \$\endgroup\$ – boboquack Feb 26 '17 at 7:16
  • \$\begingroup\$ @boboquack In regards to the edit to the question you just proposed: Different versions of the same language count as the same language. Listing "Python" alone under "Languages used..." seems to be good enough. \$\endgroup\$ – R. Kap Feb 26 '17 at 8:05
  • \$\begingroup\$ @R.Kap Thanks, that actually wasn't what I intended to edit in. The browser just auto-saved an earlier unproposed edit of the post where I copied language names, just to notice you already edited in the language names. When I went to add the multi-posters to the list, my saved version came up without my knowing. \$\endgroup\$ – boboquack Feb 26 '17 at 8:08
2
\$\begingroup\$

Answer 7: Minkolang, Distance: 4

327;N.""/class HelloWorld {static void Main() 0{;n***~
    System.Console.Write(2);
0}}//4|
8Ḥ

Try it online!

I added 7;N. to the program. Basically 3, 2 and 7 are pushed to the stack and then 2 is raised to the seventh power using ;. This is then outputted as a Number and then the program stops on the .

\$\endgroup\$
2
\$\begingroup\$

Answer 11: Charcoal, distance 5

A#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
1024p#rint(512);
#0}}//4|
β2048

Try It Online!

The uppercase Greek letters and β are variables which are assigned the ASCII characters following. The final value is implicitly printed.

\$\endgroup\$
  • \$\begingroup\$ Wait, why did you change yours to answer 10? Mine was the 10th answer. \$\endgroup\$ – R. Kap Feb 26 '17 at 7:35
  • \$\begingroup\$ @R.Kap I have moved back to 11 with an edit like I made before. \$\endgroup\$ – Jonathan Allan Feb 26 '17 at 7:39
  • \$\begingroup\$ Just a note, if you happen to use Charcoal in the future (clear) is shorter \$\endgroup\$ – ASCII-only May 19 '17 at 11:34
  • \$\begingroup\$ @ASCII-only Ah, right - thanks! \$\endgroup\$ – Jonathan Allan May 19 '17 at 17:35
2
\$\begingroup\$

Answer 10: dc, Distance of 5

#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
1024p#rint(512);
#0}}//4|
#8

Here is a valid dc program which outputs 1024.

Try it online!

\$\endgroup\$
  • \$\begingroup\$ That's not how the challenge works, yours is the 10th answer and should print 2^10 \$\endgroup\$ – Leo Feb 26 '17 at 7:30
  • \$\begingroup\$ @Leo Oh, sorry about that. That's what I get for not reading the post properly. EDIT: It has been updated \$\endgroup\$ – R. Kap Feb 26 '17 at 7:33
2
\$\begingroup\$

Answer 12: Self-modifying Brainfuck

A#327;N<.""/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
1024p#rint(512);
#0}}//4|
#β6904

Try it online!

SMBF is just like brainfuck, except the source code is available on the tape to the left of the starting position. Here we have the number to print in reverse at the end of the code, and we do <. four times to print all four digits.

I added a < before each . in the code (there were 3 of them), an extra <., and modified the final number. Distance should be 8.

\$\endgroup\$
2
\$\begingroup\$

Answer 29: Octave, Distance: 1

disp(2^29)%2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!

All I had to do was to change the 28 to 29

\$\endgroup\$
2
\$\begingroup\$

Answer 31: JavaScript ES7, Distance 7

alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

ES7 supports the ** operator for power.

You can try online here.

\$\endgroup\$
2
\$\begingroup\$

Answer 33: Mathematica, distance 9

2^33 (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'*)

Explanation

Puts everything inside comments and outputs 2^33

Please verify that this answer is valid before putting your own because I am new at this and don't want to end up breaking the chain.

\$\endgroup\$
2
\$\begingroup\$

Answer 37: Actually, distance 7

2:37@ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Replaced   36?# with :37@ⁿ.ó.

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Answer 38: RProgN, distance 10

2 38 ^ exit @ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!

Replaced 2:37 with 2 38 ^ exit (10) (note the trailing space)

Explanation:

2            2
     ^       to the power of
  38         38
       exit  Stop the prgram
\$\endgroup\$
2
\$\begingroup\$

Answer 47: Perl 6, distance 10

#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**47);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Perl 6 is considered distinct from Perl. I tried to set up C down the road by adding "% after printf, hopefully someone uses that.

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Answer 48: RProgN2, distance 9

"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**47);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^

Added a " to the start which stopped everything from breaking, the [[[ at the end clears the memory, and 268*^ calculates the new answer. Implicitly printed.

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Are you sure this counts? I already posted an RProgN version 1 answer, and I don't think multiple versions of the same language are allowed. \$\endgroup\$ – Okx Feb 27 '17 at 0:05
  • \$\begingroup\$ RProgN 2 is a full rework of RProgN 1, Much like how Perl 6 is considered different enough from Perl 5, this is considered valid. \$\endgroup\$ – ATaco Feb 27 '17 at 0:11
2
\$\begingroup\$

Answer 66, es (shell) + bc, distance 8

#64º,;S)1'a
"bc"<<x
2^66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ 
quit()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py 
p
riker
i
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Changed exit to quit(), and added iker after the first r. I couldn't resist and I wanted to add 4 more characters.

\$\endgroup\$
  • \$\begingroup\$ But we need to work towards a goal ;_; \$\endgroup\$ – Destructible Lemon Mar 1 '17 at 0:19
  • \$\begingroup\$ That sounds like a distance of 8 to me. \$\endgroup\$ – Sami Liedes Mar 1 '17 at 8:42
  • \$\begingroup\$ @SamiLiedes you're right, fixing. \$\endgroup\$ – Rɪᴋᴇʀ Mar 1 '17 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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