Bug 496359

Summary: Chess game: unfinishable game if two teams have only a king
Product: [Applications] gcompris Reporter: Quentin Caillard <quentin.caillard>
Component: generalAssignee: Jazeix Johnny <jazeix>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Quentin Caillard 2024-11-16 19:42:14 UTC
Chess game: unfinishable game if two teams have only a king
Comment 1 Jazeix Johnny 2024-11-17 14:20:56 UTC
Hi,

thanks for the report. From what I read, it should be a draw if there is "insufficient mating material" (https://support.chess.com/en/articles/8705277-what-does-insufficient-mating-material-mean).

There is a function in the engine that should check it: https://invent.kde.org/education/gcompris/-/blob/b0f8c5d37e2c72760be4c6ec6aa8c6984dfbf98a/src/activities/chess/engine.js#L921, we need to check why it does not work in this case
Comment 2 Jazeix Johnny 2024-11-17 15:42:58 UTC
Git commit c76f70fa32d4e2ad428a93d2f138338a198ae74f by Johnny Jazeix.
Committed on 17/11/2024 at 15:41.
Pushed by jjazeix into branch 'master'.

chess, allow draws due to insufficient materials

on chess 1/2 players, it will count as a win, on chess_endpart as a loss

M  +3    -0    src/activities/chess/Chess.qml
M  +7    -2    src/activities/chess/chess.js
M  +1    -0    src/activities/chess_partyend/ChessPartyEnd.qml

https://invent.kde.org/education/gcompris/-/commit/c76f70fa32d4e2ad428a93d2f138338a198ae74f
Comment 3 Jazeix Johnny 2024-11-26 21:20:14 UTC
Git commit 13b5b8226bfa2aabdca2a4157c08749d8e828885 by Johnny Jazeix.
Committed on 26/11/2024 at 21:16.
Pushed by jjazeix into branch 'KDE/4.0'.

chess, allow draws due to insufficient materials

on chess 1/2 players, it will count as a win, on chess_endpart as a loss

M  +3    -0    src/activities/chess/Chess.qml
M  +7    -2    src/activities/chess/chess.js
M  +1    -0    src/activities/chess_partyend/ChessPartyEnd.qml

https://invent.kde.org/education/gcompris/-/commit/13b5b8226bfa2aabdca2a4157c08749d8e828885