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

Feature/fix issue418 #427

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Feature/fix issue418 #427

wants to merge 6 commits into from

Conversation

JoshuaGreen
Copy link
Collaborator

This is my proposed fix to Issue #418. Analogously to Issues #413, #414, and #419, the "problem" seems to be that the move generation logic sometimes tries to move pieces off the board. As with PR #426, the simplest solution is to expand the array with appropriate slack space, a technique used elsewhere for the same purpose. In each of the cases here we (apparently) need only ensure that there's enough slack to enable stepping one space outside the board, and for move_diff_code this only requires adding one additional row.

As long as I was making the above change, I also took the liberty of abstracting the interface. No more remembering that we have to pass abs(from - to); instead we'll just call a simple function that will do whatever is necessary.

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.

1 participant