Skip Menu |

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

Report information
The Basics
Id: 54231
Status: resolved
Priority: 0/
Queue: Chess-Rep

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

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



Subject: Problem in the computation of the FEN castling
Date: Tue, 2 Feb 2010 21:20:09 +0100
To: bug-Chess-Rep [...] rt.cpan.org
From: Olivier Macchioni <olivier.macchioni [...] gmail.com>
Version 0.6 Apparently there is a bug in some cases when computing the castling availability. For instance with this code: #!/usr/bin/perl use Chess::Rep; my $pos = Chess::Rep->new("4k2r/6K1/8/8/8/8/8/8 w k - 0 16"); $pos->go_move ('Kxh8'); print $pos->get_fen()."\n"; I'd expect the resulting castling to be "-", ie no castling allowed. Instead the result is the following: 4k2K/8/8/8/8/8/8/8 b k - 0 16 It doesn't make sense as there is no Rook left on the board, Mac
Subject: Re: [rt.cpan.org #54231] AutoReply: Problem in the computation of the FEN castling
Date: Tue, 2 Feb 2010 21:43:38 +0100
To: bug-Chess-Rep [...] rt.cpan.org
From: Olivier Macchioni <olivier.macchioni [...] gmail.com>
I think the problem is with _move_piece The "elsif" all over the place will actually skip some cases - for instance a move h1h8 should forbid at the same time CASTLE_B_OO and CASTLE_W_OO
Subject: Re: [rt.cpan.org #54231] AutoReply: Problem in the computation of the FEN castling
Date: Tue, 2 Feb 2010 22:51:05 +0200
To: bug-Chess-Rep [...] rt.cpan.org
From: Mihai Călin Bazon <mihai.bazon [...] gmail.com>
This seems correct. Removing the "els" in "elsif"-s fixes the problem, and I'm pretty sure there's no downside. Good catch! :-) I will push a new version with this soon. BTW, Olivier, would you like to take over maintenance of this module? I'm not sure I'll have the time to work on it in the future (in fact I didn't do anything significant on it in a long time now). -Mihai On Tue, Feb 2, 2010 at 10:44 PM, Olivier Macchioni via RT <bug-Chess-Rep@rt.cpan.org> wrote: Show quoted text
>       Queue: Chess-Rep >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=54231 > > > I think the problem is with _move_piece > > The "elsif" all over the place will actually skip some cases - for instance > a move h1h8 should forbid at the same time CASTLE_B_OO and CASTLE_W_OO > >
-- Mihai Bazon, http://mihai.bazon.net/blog
Pushed v0.7 to CPAN, which fixes this.