Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell signedness examples #24

Merged
merged 7 commits into from
Oct 10, 2018
Merged

Conversation

cpressey
Copy link
Member

@cpressey cpressey commented Oct 4, 2018

Addresses #23 directly by adding a Befunge-93 cell signedness checker, as mentioned there.

I think this PR fixes (either the source or the description of) all the examples in #20 that fail to do what they say because they rely on unsigned char playfield cells. If there are any others where cell signedness is definitely the culprit, they could be added here, though I think in the other cases it is mainly due to other things.

(OK, actually the issues of numer.bf turned out to not be anything about signedness, but it got fixed here anyway.)

Copy link

@j4james j4james left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this program (I'm referring to the sign test) only works correctly for implementations with 8 bit memory cells, which in the wild world of Befunge interpreters is far from guaranteed. Any implementation with a larger cell size will report as unsigned whether they are or not. One obvious group being all the Befunge-98 interpreters, but it's not uncommon for Befunge-93 implementations to use larger memory cells too.

@cpressey
Copy link
Member Author

cpressey commented Oct 5, 2018

@j4james That's true, so I've rewritten the test program to take a different approach that maybe gets more to the point: the Befunge-93 programmer is interested in what the largest and smallest values they can use are, regardless of how it's implemented under the hood.

(Compatibility between Befunge-93 and Befunge-98 is known to be, um, "approximate", so if running any of these programs in a Befunge-98 interpreter results in hilarity ensuing, I'm fine with that.)

@cpressey cpressey merged commit 6d7d444 into examples-fixes Oct 10, 2018
@cpressey cpressey deleted the cell-signedness-examples branch November 16, 2018 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants