đŸ Archived View for alaskalinuxuser.ddns.net âș 2023-10-04.gmi captured on 2024-09-29 at 00:21:51. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
">
76w, https://alaskalinuxuser3.ddns.net/wp-content/uploads/2023/10/
Screenshot_20190609-212239-169x300.png 169w, https://alaskalinuxuser3.ddns.net/
wp-content/uploads/2023/10/Screenshot_20190609-212239-768x1365.png 768w, https:
//alaskalinuxuser3.ddns.net/wp-content/uploads/2023/10/Screenshot_20190609-
212239-864x1536.png 864w, https://alaskalinuxuser3.ddns.net/wp-content/uploads/
2023/10/Screenshot_20190609-212239.png 1080w" sizes="(max-width: 295px)
100vw, 295px" />
In case you didnât catch that, donât feel bad, I didnât either. It is French
for âEndgame problemâ. The rest of the issue on the tracker went like this:
âQuand il nây a plus que les deux rois, la partie ne sâarrĂÂȘte pas.â Which
translates to âWhen there are only the two kings, the game does not stop.â You
can read the full issue on the tracker here:
https://gitlab.com/alaskalinuxuser/app_JustChess/-/issues/16
The problem was that I didnât have any function to check for insufficient
material. There was a function for checking stalemate, or checkmate, but
nothing to check the board and determine if you have too little material to win
the game. So, I added one with this commit:
https://gitlab.com/alaskalinuxuser/app_JustChess/-/commit/
954d48a95856efe1d706d71e3c969ad50b709a1a
The main idea was just to have a function call that runs through all the pieces
of the board. It starts by assuming that you do not have enough pieces left to
win the game, and then uses a switch/case block to check each piece. If the
white or black pieces have either a rook, a queen, or a pawn, the game still
has sufficient material.
if (wKnightBishop > 1 || bKnightBishop > 1){\n // Because there is
more than one knight or bishop or combo, then there is sufficient material.\n
insufficient = false;\n }
And, using the above code, with the switch/case block adding a point for each
knight or bishop, then having more than one knight and/or bishop will result in
still having enough material.
There are three technicalities that I forgot, though, which is having one
knight each, or one bishop each of opposite color, or, this will claim that you
have sufficient material with two bishops, even if they are both the same
color. Technically, the first two are not a draw, because it is possible to
still have a checkmate. However, it is practically a draw, because most sane
players wouldnât fall trap to it. But, Iâll have to come back to that. The last
one is technically a draw, but the engine doesnât know it.
For now, it is much more playable, and this insufficient material rule will
work in almost all games, based off of a search of all rated classical games
played on Lichess last weekend that ended in a draw due to insufficient
material (September 30 through October 1, https://lichess.org/games/
search?ratingMin=400&ratingMax=2900&hasAi=0&perf=3&mode=1&status=34&dateMin=2023-
09-30&dateMax=2023-10-01&sort.field=d&sort.order=desc). And you can download
the latest version of the app here:
https://gitlab.com/alaskalinuxuser/app_JustChess/-/tree/master/
app?ref_type=heads
Or hopefully soon on F-Droid.
Linux â keep it simple.