Chess changes: en passant and not suggesting illiegal moves

Tyson Williams tyson.d.w at gmail.com
Fri Jun 5 13:18:04 BST 2020


!Hello everyone,

My children (twin 6yos and 4yo) love playing the activities in GCompris.
In particular, one of my 6yos especially enjoys that he can been me at the
flying kings variant of checkers.

Anyway, there are two improvements that I would like to make to the chess
activities.

The first is that en passant <https://en.wikipedia.org/wiki/En_passant> is
not a supported move.  I would like to add support for them.

The second is about the inconsistency in which moves are displayed as
possible.  After clicking on a piece, the general behavior is that the
squares to which that piece can move are highlighted.  The suggested moves
vary according to the situation in many cases.

Here are five cases in which only legal moves are suggested:
- Opponent pieces in the way (e.g. if R on a1 can capture at a2, then
capturing at a3 is not suggested)
- Own piece in the way (e.g. there are no suggested moves for the king as
the first move of the game)
- Pawn's first vs non-first move (i.e. only when it is a pawn's first move
and the two squares in front of it are empty is the suggestion given to
move the pawn forward two squares)
- Pawn capture (i.e. only if an enemy piece is diagonally in front of a
pawn is the suggestion given to move in that diagonal direction)
- Castling (i.e. castling the king by moving it horizontally is only
suggested if it is valid...which means the king has never moved, the rook
as never moved, square the king moves through is not being attached, and
the square the king stops on is not being attached)

In contrast, there is one case in which invalid moves are suggested, which
is when the king of that player would become under attack (except for
castling as mentioned above).  I know of four ways in which this can happen:
- Suggestions are given to move the king to a square that is under attack.
- Suggestions are given to move a piece that is absolutely pinned
<https://en.wikipedia.org/wiki/Pin_(chess)#Absolute_pin>.
- For a piece that can put itself into an absolute pin, suggestions are
given to move that piece that would not place it into an absolute pin.
- For a piece that can capture a piece attacking the king, suggests are
given to move that piece that does not capture that piece or place it into
an absolute pin.

If the user clicks such an illegal suggestion, the follow message is
displayed.
> "Invalid, your king may be in check"

This message makes me think that I have missed some case....that the game
can suggest a move that is illegal for some reason other than the king
being under attack after the move.  However, I have been unable to find
such a case.

When my children play chess and their king becomes checked, they click the
suggested moves to get out of check, but many of them are illegal and
display that message to them.  I would prefer if those illegal moves were
not suggested.

Would making en passant possible and removing illegal move suggestions be
welcome changes to the chess activities?

-- 
Tyson Williams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gcompris-devel/attachments/20200605/942422af/attachment.htm>


More information about the GCompris-devel mailing list