2 of 2
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Befunge, 15 bytes, James Holderness
<:0:+1_@#%9,:g-
Explanation
The catch here is that the loop terminates when the current character is divisible by 9, which is only the case for -. Hence, that needs to go at the end.
< Run code from right to left.
- There will always be 2 zeros on top of the stack at this
point, and this just reduces them to 1 zero.
g Get the character at the coordinates given by the top
two stack values, (0, 0) initially.
,: Print a copy of that character.
%9 Modulo 9.
_@# Terminate if that is 0.
+1 Increment the x coordinate.
: Duplicate it.
:0 Push two zeros.
Martin Ender
- 198.2k
- 67
- 455
- 998