{"action":"created","issue":{"url":"https://api.github.com/repos/catseye/Befunge-93/issues/20","repository_url":"https://api.github.com/repos/catseye/Befunge-93","labels_url":"https://api.github.com/repos/catseye/Befunge-93/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/catseye/Befunge-93/issues/20/comments","events_url":"https://api.github.com/repos/catseye/Befunge-93/issues/20/events","html_url":"https://github.com/catseye/Befunge-93/issues/20","id":364002746,"node_id":"MDU6SXNzdWUzNjQwMDI3NDY=","number":20,"title":"Examples that don't appear to work","user":{"login":"j4james","id":4181424,"node_id":"MDQ6VXNlcjQxODE0MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4181424?v=4","gravatar_id":"","url":"https://api.github.com/users/j4james","html_url":"https://github.com/j4james","followers_url":"https://api.github.com/users/j4james/followers","following_url":"https://api.github.com/users/j4james/following{/other_user}","gists_url":"https://api.github.com/users/j4james/gists{/gist_id}","starred_url":"https://api.github.com/users/j4james/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j4james/subscriptions","organizations_url":"https://api.github.com/users/j4james/orgs","repos_url":"https://api.github.com/users/j4james/repos","events_url":"https://api.github.com/users/j4james/events{/privacy}","received_events_url":"https://api.github.com/users/j4james/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-09-26T12:26:10Z","updated_at":"2018-10-04T22:32:09Z","closed_at":null,"author_association":"NONE","body":"While I'm raising issues about the examples, this is something that really frustrated me when I first started learning Befunge. When you try and run these examples, a significant percentage of them don't actually appear to work. There are four broad categories of problems here:\r\n\r\n1. Programs that were written before you added warnings in the reference interpreter. So now unless you know to start the interpreter with `-i` (or in some cases `-q`), these examples can generate a lot of warnings, in many cases overwhelming the actual output, and making them appear to be broken. This includes: **beer4.bf**, **beer10.bf**, **befunge1.bf**, **befunge3.bf**, **befunge4.bf**, **befungex.bf**, **bridgeit.bf**, **palinqn.bf**, and **rand13.bf**.\r\n2. Programs that include b97 directive headers, which generally just fail outright unless you know to start the interpreter with the `-=` option. This include: **postfix.bf**, **postfix2.bf**, **quine.bf**, **quine2.bf**, **quine3.bf**, and **revquine.bf**.\r\n3. Programs that are simply just buggy (some more so than others). This includes: **beer.bf**, **befbef.bf**, **digitalr.bf**, **easm.bf**, **numer.bf**, **rand13.bf**, and **serp.bf**. In a number of cases these already have fixes though (**befbef.bf** was fixed by **befbef2.bf**, **easm.bf** seems to have been fixed by **easm2.bf**, and **serp.bf** was fixed by **serp2.bf**).\r\n4. Programs that have a variety of other problems: **pi2.bf** (this is Befunge-97 not Befunge-93), **switchbx.bf** (essentially a snippet of code - not actually runnable by itself), **prime.bf** and **rand12.bf** (expect unsigned memory cells, so while partially working, the output isn't what was intended).\r\n\r\nGroups 1 and 2 can possibly be addressed by including an indicator of some sort (e.g. something like a footnote marker) just letting people know that they need to run those examples with the required option enabled. Note that in group 1, most will work with either `-i` or `-q`, but **bridgeit.bf** and **palinqn.bf** _must_ use the `-q` option.\r\n\r\nGroup 3 is more of an issue, but I would have thought you could at least get rid of the broken examples when there is a working replacement. And if you think the broken code is worth keeping for historical interest, perhaps you could move those examples into a separate subdirectory? But worst case, some kind of marker in the readme would be better than nothing.\r\n\r\nAs for the rest, **pi2.bf** I'd maybe suggest moving to your FBBI example collection, since the code is still forward compatible with Befunge-98. The others I don't know - maybe just mention something in the readme notes again.\r\n\r\nAll that said, if I were you I'd probably reconsider whether it's worth keeping many of these examples. I mean do you really need 15 random number generators and 10 different versions of \"99 bottles of beer\"? The good stuff kind of gets drowned out amongst all the repeats."},"comment":{"url":"https://api.github.com/repos/catseye/Befunge-93/issues/comments/427190821","html_url":"https://github.com/catseye/Befunge-93/issues/20#issuecomment-427190821","issue_url":"https://api.github.com/repos/catseye/Befunge-93/issues/20","id":427190821,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzE5MDgyMQ==","user":{"login":"j4james","id":4181424,"node_id":"MDQ6VXNlcjQxODE0MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4181424?v=4","gravatar_id":"","url":"https://api.github.com/users/j4james","html_url":"https://github.com/j4james","followers_url":"https://api.github.com/users/j4james/followers","following_url":"https://api.github.com/users/j4james/following{/other_user}","gists_url":"https://api.github.com/users/j4james/gists{/gist_id}","starred_url":"https://api.github.com/users/j4james/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j4james/subscriptions","organizations_url":"https://api.github.com/users/j4james/orgs","repos_url":"https://api.github.com/users/j4james/repos","events_url":"https://api.github.com/users/j4james/events{/privacy}","received_events_url":"https://api.github.com/users/j4james/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T22:32:09Z","updated_at":"2018-10-04T22:32:09Z","author_association":"NONE","body":"Looking at the code for **digitalr.bf**, it definitely looks to me like it's intended to work with numbers and not letters. Every character that is read has 48 subtracted (i.e. ASCII '0') to get the numeric value. That value is added to a sum, and when the sum is greater than 9 it calculates mod 9 of that value to make it a single digit. It's not an unreasonable algorithm for turning a string of digits into a single digit - it just isn't the actual algorithm for a digital root.\r\n\r\nAs for **prime.bf**, it occurred to me that it's not so much that the memory cells need to be unsigned - they just need to have a higher upper bound than 127. So it's possible you made the changes when you were using FBBI, which would have 32-bit memory cells (at least), and thus is easily capable of handling primes up to 254."}}
{"actor":{"display_login":"j4james"}}