Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Befunge-98, 97 points!

"v!dlrow ,h
B[CDEFGIJkLMNOPH
$<QRSTUV@|5cg1fe':-%64円*ab+7_/89}{0 j2
WXYZK`.=#>]
s()impq	n 3~
Atuxz&;y^ ?

Try it online!

The tab is between the q and the n.

Uses a similar trick to the previous Befunge answer to pad the lines with the leftover characters, but avoids using duplicate characters in the executing section. Removing any of the non-executing characters results in the executing parts being out of place, usually ending up in infinite loops or printing the wrong output.

###How It Works

How It Works

Really, the only executing part looks like:

"v!dlrow ,h
 k H
$< @|5cg1fe':-%64円*ab+7
 >]
 ^ ?

First it uses a wrapping string literal to add , world! to the stack. This avoids two "s.

$< @|5cg1fe':-%64円*ab+7

This adds Hello to the stack using a variety of methods to avoid duplicate characters. $ pops the excess space caused by the wrapping string literal.

7+ adds 7 to the h from the end of the string literal to create the o . ba*46\%: calculates 111, the ascii value of l and duplicates it.

'e adds e to the stack.

f1g gets the character at 1,15 which is the H

It then reuses the , in the string to print out the whole Hello, world!. The rest is just direction changes to navigate to the ending @.

Befunge-98, 97 points!

"v!dlrow ,h
B[CDEFGIJkLMNOPH
$<QRSTUV@|5cg1fe':-%64円*ab+7_/89}{0 j2
WXYZK`.=#>]
s()impq	n 3~
Atuxz&;y^ ?

Try it online!

The tab is between the q and the n.

Uses a similar trick to the previous Befunge answer to pad the lines with the leftover characters, but avoids using duplicate characters in the executing section. Removing any of the non-executing characters results in the executing parts being out of place, usually ending up in infinite loops or printing the wrong output.

###How It Works

Really, the only executing part looks like:

"v!dlrow ,h
 k H
$< @|5cg1fe':-%64円*ab+7
 >]
 ^ ?

First it uses a wrapping string literal to add , world! to the stack. This avoids two "s.

$< @|5cg1fe':-%64円*ab+7

This adds Hello to the stack using a variety of methods to avoid duplicate characters. $ pops the excess space caused by the wrapping string literal.

7+ adds 7 to the h from the end of the string literal to create the o . ba*46\%: calculates 111, the ascii value of l and duplicates it.

'e adds e to the stack.

f1g gets the character at 1,15 which is the H

It then reuses the , in the string to print out the whole Hello, world!. The rest is just direction changes to navigate to the ending @.

Befunge-98, 97 points!

"v!dlrow ,h
B[CDEFGIJkLMNOPH
$<QRSTUV@|5cg1fe':-%64円*ab+7_/89}{0 j2
WXYZK`.=#>]
s()impq	n 3~
Atuxz&;y^ ?

Try it online!

The tab is between the q and the n.

Uses a similar trick to the previous Befunge answer to pad the lines with the leftover characters, but avoids using duplicate characters in the executing section. Removing any of the non-executing characters results in the executing parts being out of place, usually ending up in infinite loops or printing the wrong output.

How It Works

Really, the only executing part looks like:

"v!dlrow ,h
 k H
$< @|5cg1fe':-%64円*ab+7
 >]
 ^ ?

First it uses a wrapping string literal to add , world! to the stack. This avoids two "s.

$< @|5cg1fe':-%64円*ab+7

This adds Hello to the stack using a variety of methods to avoid duplicate characters. $ pops the excess space caused by the wrapping string literal.

7+ adds 7 to the h from the end of the string literal to create the o . ba*46\%: calculates 111, the ascii value of l and duplicates it.

'e adds e to the stack.

f1g gets the character at 1,15 which is the H

It then reuses the , in the string to print out the whole Hello, world!. The rest is just direction changes to navigate to the ending @.

Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

Befunge-98, 97 points!

"v!dlrow ,h
B[CDEFGIJkLMNOPH
$<QRSTUV@|5cg1fe':-%64円*ab+7_/89}{0 j2
WXYZK`.=#>]
s()impq	n 3~
Atuxz&;y^ ?

Try it online!

The tab is between the q and the n.

Uses a similar trick to the previous Befunge answer to pad the lines with the leftover characters, but avoids using duplicate characters in the executing section. Removing any of the non-executing characters results in the executing parts being out of place, usually ending up in infinite loops or printing the wrong output.

###How It Works

Really, the only executing part looks like:

"v!dlrow ,h
 k H
$< @|5cg1fe':-%64円*ab+7
 >]
 ^ ?

First it uses a wrapping string literal to add , world! to the stack. This avoids two "s.

$< @|5cg1fe':-%64円*ab+7

This adds Hello to the stack using a variety of methods to avoid duplicate characters. $ pops the excess space caused by the wrapping string literal.

7+ adds 7 to the h from the end of the string literal to create the o . ba*46\%: calculates 111, the ascii value of l and duplicates it.

'e adds e to the stack.

f1g gets the character at 1,15 which is the H

It then reuses the , in the string to print out the whole Hello, world!. The rest is just direction changes to navigate to the ending @.

AltStyle によって変換されたページ (->オリジナル) /