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

Allow short algebraic notation #13

Open
martsberger opened this issue Mar 30, 2017 · 1 comment
Open

Allow short algebraic notation #13

martsberger opened this issue Mar 30, 2017 · 1 comment

Comments

@martsberger
Copy link

It would be nice if we could input the moves using the short algebraic notation that is standard in the pgn format, e.g., e4 e5 Nf3, in addition to the long format currently supported.

The public api would get only one additional method, Game.apply_san_move(san_string). I have already implemented this and will open a pull request. I'd like to use Chessnut in a hobby project, but want to be able to read in pgn games.

martsberger pushed a commit to martsberger/Chessnut that referenced this issue Mar 30, 2017
Add a San class to parse and store the internals of a short algebraic move.
Add san_to_long method to Game to convert the san move to the long version.
Add apply_san_move method to Game to apply the move

Replace xrange with range so that tests run in python3

Add find_all_pieces method to Board similar to find_piece, but returns a list of all indexes instead of just the first one.

Add tests to cover all the new code.
@ctataryn
Copy link

@cgearhart would be great if you could take a look at this and merge if approved.

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

No branches or pull requests

2 participants