One thing I fixed was where, which you're using in your doubleleap function. I modified it to return false when it calculates a coordinate that doesn't exist, such as an unpaired file or rank marker. However, it didn't fix things for your King.
As I understand how the Catapult and the Skirmisher work from your rules page, they capture by en passant. But in your stalemated subroutine, you're executing the command move #to #after after you have executed move #from #to, and this will move the piece you just moved to #to to #after, changing its position on the board from what it should actually be. If these pieces just capture by en passant, then you should just remove the piece on #after instead of moving the capturing piece there.
One thing I fixed was
where
, which you're using in yourdoubleleap
function. I modified it to return false when it calculates a coordinate that doesn't exist, such as an unpaired file or rank marker. However, it didn't fix things for your King.As I understand how the Catapult and the Skirmisher work from your rules page, they capture by en passant. But in your
stalemated
subroutine, you're executing the commandmove #to #after
after you have executedmove #from #to
, and this will move the piece you just moved to#to
to#after
, changing its position on the board from what it should actually be. If these pieces just capture by en passant, then you should just remove the piece on #after instead of moving the capturing piece there.