Closed dlbbld closed 3 years ago
I'm not affiliated with this project, but just found this issue anyway. It seems that different organizations have different rules on what is considered "insufficient material": https://support.chess.com/article/128-what-does-insufficient-mating-material-mean Namely, "USCF rule specifies that the game is drawn because there is no forced mate" but "FIDE rule specifies that the game is drawn only when there is no possible mate".
At the very least it seems that the isInsufficientMaterial
method must have the assumptions specified in its Javadocs. In addition, one might want to create a new method (or two) for querying the sufficiency of material by different rules. The current one could even be deprecated and removed in some future major version.
This topic is very involved. To start with, the article you quote is incorrect. The FIDE and USCF rules are the same for the situation here. They are different when timeout is involved. This method is about the first situation. For the second situation (see also #41), the side as an argument would have to be supplied.
Without any comment, I assume the method implements the FIDE / USCF rule. Then there are the mentioned bugs.
Please check pull request https://github.com/bhlangonijr/chesslib/pull/68. Also contains the "one-sided" insufficient material checks mentioned in #41.
Closing the issue as it became stale.
The method
Board.isInsufficientMaterial
returns true for KNvKN, KBvKN and KNvKB, but should return false (checkmate with cooperation of opponent always possible).