Okay, I fixed the problem with suicide moves. I was thinking there were only two ways of writing them, but there were three, and by conflating two of these together, I had failed to update one of them to save values for $old and $moved when a suicide move is made. Given the multiple ways for writing these moves, I had decided to test for a suicide move by checking whether the moving piece and the last captured piece were the same, but for the full notation way of writing a suicide move, I hadn't done that.
Okay, I fixed the problem with suicide moves. I was thinking there were only two ways of writing them, but there were three, and by conflating two of these together, I had failed to update one of them to save values for
$old
and$moved
when a suicide move is made. Given the multiple ways for writing these moves, I had decided to test for a suicide move by checking whether the moving piece and the last captured piece were the same, but for the full notation way of writing a suicide move, I hadn't done that.