Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 5
    \$\begingroup\$ Doesn't this output null bytes if the stack is empty? \$\endgroup\$ Commented May 14, 2017 at 4:18
  • \$\begingroup\$ The implementation I linked doesn't; I agree by the Befunge spec it should. \$\endgroup\$ Commented May 14, 2017 at 12:44
  • 2
    \$\begingroup\$ Funny, the browser eats null bytes. It calls its implementation of putchar("\0"), but FF purges it from the HTML: >> document.getElementById("output").innerHTML = "a\0b" >> document.getElementById("output").innerHTML "ab" \$\endgroup\$ Commented May 14, 2017 at 21:53
  • \$\begingroup\$ Aha, I wondered if something weird was happening in the browser. I guess my Chrome does that too. Well, that is a heck of a technicality then, but I guess it's more or less in the spirit of the site to post a solution that only works in some interpreters run in some environments. \$\endgroup\$ Commented May 15, 2017 at 18:22