đŸ’Ÿ 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

View Raw

More Information

-=-=-=-=-=-=-

Justchess 2.2 – Fix “problùme en fin de partie”

">

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.