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

Flobnar, 6 bytes

~,_@
e

Try it online!

Suggested by Esolanging Fruit, this solution is much shorter, but ends in an error. Thanks!

Below is my old solution, which terminates correctly, but doesn't handle EOF correctly.

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Flobnar, 6 bytes

~,_@
e

Try it online!

Suggested by Esolanging Fruit, this solution is much shorter, but ends in an error. Thanks!

Below is my old solution, which terminates correctly, but doesn't handle EOF correctly.

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Flobnar, 6 bytes

~,_@
e

Try it online!

Suggested by Esolanging Fruit, this solution is much shorter, but ends in an error. Thanks!

Below is my old solution, which terminates correctly, but doesn't handle EOF correctly.

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

better solution auggested by esolanging fruit
Source Link
Jo King
  • 48.1k
  • 6
  • 130
  • 187

Flobnar, 6 bytes

~,_@
e

Try it online!

Suggested by Esolanging Fruit, this solution is much shorter, but ends in an error. Thanks!

Below is my old solution, which terminates correctly, but doesn't handle EOF correctly.

Flobnar , 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Alternatively, this works for 16 bytes:

\#\<@:!_
, ~
: 0

Try it online!

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Alternatively, this works for 16 bytes:

\#\<@:!_
, ~
: 0

Try it online!

Flobnar, 6 bytes

~,_@
e

Try it online!

Suggested by Esolanging Fruit, this solution is much shorter, but ends in an error. Thanks!

Below is my old solution, which terminates correctly, but doesn't handle EOF correctly.

Flobnar , 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

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

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Alternatively, this works for 16 bytes:

\#\<@:!_
, ~
: 0

Try it online!

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

Flobnar, 15 bytes

|\<@:
:~
,0
_ ^

Try it online!

###Explanation:

We start at the @, going left. The \ evaluates below it, and stores it in the call stack. This is either the next byte of input from ~, or 0 if it is EOF. Next, it passes through the | to check if the top value of the call stack (:) is non-zero. If it is not, the pointer goes down from the | and returns the top value of the call stack. Otherwise, it goes up and wraps around to the _. This is also a conditional, which first evaluates printing (,) the top of the call stack. Printing always returns 0, so it goes right to the ^ which starts the loop all over again.

Alternatively, this works for 16 bytes:

\#\<@:!_
, ~
: 0

Try it online!

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

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