SindreSvendby / pgnToFen

Takes PGN as input and returns FEN
MIT License
32 stars 10 forks source link

Error in conversion #2

Closed balarajv closed 5 years ago

balarajv commented 6 years ago

Thanks for the library

I'm getting List index out of range for the following list

['d4', 'd5', 'c4', 'dxc4', 'e4', 'e5', 'Nf3', 'exd4', 'Bxc4', 'Nc6', 'O-O', 'Be6', 'Bb5', 'Bc5', 'Nbd2', 'Ne7', 'Ng5', 'Qd7', 'Nxe6', 'Qxe6', 'Nb3', 'Qe5', 'f4', 'Qd6', 'e5', 'Qd5', 'Qd3', 'Bb6', 'Bd2', 'a5', 'Bc4', 'Qd7', 'Rae1', 'Qf5', 'Nc1', 'a4', 'Re2', 'Ba5', 'e6', 'fxe6', 'Bxe6', 'Qxd3', 'Nxd3', 'Bxd2', 'Rxd2', 'b6', 'g4', 'Nd8', 'Bc4', 'Ra5', 'Ne5', 'c5', 'Re1', 'b5', 'Bd3', 'g6', 'f5', 'gxf5', 'gxf5', 'c4', 'Be4', 'Ra6', 'Rxd4', 'Rf8', 'Nd7', 'Rf7', 'f6', 'Raxf6', 'Nxf6+', 'Rxf6', 'Bxh7', 'Nc6', 'Rd2', 'a3', 'bxa3', 'Kf7', 'Rd7', 'Kf8', 'Rb7', 'Rh6', 'Be4', 'Nd4', 'a4']

raceback (most recent call last): File "", line 1, in File "pgntofen.py", line 122, in pgnToFen self.move(move) File "pgntofen.py", line 142, in move self.handleAllmoves(move) File "pgntofen.py", line 204, in handleAllmoves self.pawnMove(toPosition, specificCol, specificRow, takes, promote) File "pgntofen.py", line 477, in pawnMove self.updateOldLinePos(piece,chessBoardNumber, toPosition) File "pgntofen.py", line 501, in updateOldLinePos piece = self.internalChessBoard[posistion] IndexError: list index out of range

SindreSvendby commented 5 years ago

Hi!

Sorry for the delay, did not see this issue, Do you have some test file to replicate this? The test suite, are processing 2000 real games if I remember correctly, in addition to all the spesific testcases, it should not be any know bugs here.