Skip Menu |

This queue is for tickets about the Chess-PGN-EPD CPAN distribution.

Report information
The Basics
Id: 69206
Status: new
Priority: 0/
Queue: Chess-PGN-EPD

People
Owner: Nobody in particular
Requestors: ludens [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: small bug in parsing rare (legal) SAN moves
Date: Thu, 30 Jun 2011 10:42:37 -0700
To: bug-Chess-PGN-EPD [...] rt.cpan.org
From: "ludens [...] gmail.com" <ludens [...] gmail.com>
Hi, Chess-PGN-EPD-0.29 has a little problem parsing rare legal SAN moves. White's move 68 in the example game (Rf8f2, see below) fails with undefined $from in epdlist because movetype returns "Not yet handled". It looks like this (non-capture) case was just forgotten because it is already there for capturing moves. Proposed fix: Add elsif ( $move =~ /^([RNBQK])([a-h][1-8])([a-h][1-8])(?:\+|\#)?$/ ) { @result = ( $1, $3, $2 ); } in line 1049 (function movetype). Also, line 706 should read my $debug = @_ ? ( $moves[-1] eq '1' ) : 0; to make sure debug is 0 instead of undefined for empty move lists (ie White or Black resigns on move 1). Thank you for an extremly valuable library, it is nice to see that you keep improving it. Klaus ----------- example game 1. d4 g6 2. Bf4 Bg7 3. Nf3 d6 4. Nc3 Nf6 5. e3 O-O 6. Qd3 Nbd7 7. h4 c5 8. dxc5 Nxc5 9. Qe2 b6 10. O-O-O Ba6 11. Qe1 Bxf1 12. Qxf1 Nce4 13. Nxe4 Nxe4 14. g4 Rc8 15. Qd3 Nc5 16. Qe2 b5 17. h5 Qa5 18. a3 Qa4 19. c3 Nb3+ 20. Kb1 b4 21. cxb4 a5 22. bxa5 Nxa5 23. hxg6 fxg6 24. Bh6 Bxb2 25. Bxf8 Qxa3 26. Qxb2 Qa4 27. Qa2+ Qc4 28. Qxc4+ Rxc4 29. Bxe7 Nc6 30. Bxd6 Ra4 31. Rd2 Rxg4 32. Ne5 Ra4 33. Nxc6 Ra6 34. Rc2 Rb6+ 35. Kc1 Kf7 36. Rxh7+ Ke6 37. Bf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