niklasf / chessops

Chess and chess variant rules and operations in TypeScript
https://niklasf.github.io/chessops/
GNU General Public License v3.0
118 stars 34 forks source link

Chess.hasInsufficientMaterial not entirely correct #152

Closed schlawg closed 1 year ago

schlawg commented 1 year ago

I believe it should return true when a color has only the king & one bishop remaining. However, it returns false when both sides have a single bishop provided that the bishops occupy both square colors, even though neither side can mate.

niklasf commented 1 year ago

With opposite-colored bishops helpmate is possible:

[FEN "7k/8/7K/2Bb4/8/8/8/8 b - - 0 1"]

1... Bg8 1. Bd4#

(setup)

schlawg commented 1 year ago

TIL!