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

Pgn reader uses older version of shakmaty which causes problems when using both in the same program #24

Closed
hyperchessbot opened this issue Jan 1, 2021 · 1 comment

Comments

@hyperchessbot
Copy link

When using both shakmaty and pgn reader within the same program, official example for determining final position does not compile ( compiler hints at different versions of shakmaty ).

In particular san could not be converted to move. The solution was to first convert san to string, then parse this string with new version of shakmaty and convert it to move.

fn san(&mut self, san_plus: SanPlus) {
		let san_orig = san_plus.san;
		let san_str = format!("{}", san_orig);        
		let san_result:std::result::Result<San, _> = san_str.parse();
		match san_result {
			Ok(san) => {
				let move_result = san.to_move(&self.pos);
                                match move_result {
					Ok(m) => {
						self.pos.play_unchecked(&m);
@niklasf niklasf closed this as completed in 7389d1e Jan 1, 2021
@niklasf
Copy link
Owner

niklasf commented Jan 1, 2021

I am not very happy with the current state of this library (#12 / #17), but no reason not to publish a release with updated versions. Should be compatible with the latest shakmaty now.

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