<div dir="auto">Thanks Johnny,<div dir="auto"><br></div><div dir="auto">If the move suggestions are an easy fix for you, then by all means, go ahead.  I will put it on my TODO list a well.  My typical development environment includes C# or F#, Visual Studio, and Azure DevOps or GitHub, so the different environment will be a challenge, but I am willing to try.  Your links into the code will be very helpful.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 7, 2020, 5:20 AM Johnny Jazeix <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I removed the images from your mail, created a bug on our tracker<br>
(<a href="https://phabricator.kde.org/T13248" rel="noreferrer noreferrer" target="_blank">https://phabricator.kde.org/T13248</a>) and added the images in it<br>
<a href="https://phabricator.kde.org/M175" rel="noreferrer noreferrer" target="_blank">https://phabricator.kde.org/M175</a>.<br>
For the en-passant move, I probably won't have the knowledge to fix it quickly.<br>
<br>
For restraining the moves to the only "really" possible ones, it<br>
should be possible:<br>
<a href="https://invent.kde.org/education/gcompris/-/blob/master/src/activities/chess/chess.js#L317" rel="noreferrer noreferrer" target="_blank">https://invent.kde.org/education/gcompris/-/blob/master/src/activities/chess/chess.js#L317</a>:<br>
we display the possible moves.<br>
Here is the function where we check if the move is legal or not:<br>
<a href="https://invent.kde.org/education/gcompris/-/blob/master/src/activities/chess/chess.js#L151" rel="noreferrer noreferrer" target="_blank">https://invent.kde.org/education/gcompris/-/blob/master/src/activities/chess/chess.js#L151</a><br>
<br>
I can add it in my todo list, except if you want to take a look.<br>
<br>
Johnny<br>
<br>
Le dim. 7 juin 2020 à 03:30, Tyson Williams <<a href="mailto:tyson.d.w@gmail.com" target="_blank" rel="noreferrer">tyson.d.w@gmail.com</a>> a écrit :<br>
><br>
> Hello everyone,<br>
><br>
> I decided to only take screenshots for the incorrect cases, of which there are five.<br>
><br>
> The first is that en passant is not possible but should be.  See attached file "en_passant.png".<br>
><br>
> The other four cases are moves that are suggested but should NOT be.  In all four cases, only the suggestions are wrong.  Trying to play at any of these "bad" suggestions displays the error message "Invalid, your king may be in check".<br>
> 1. Suggested moves for the king should not include moving to a square that is under attack.  In the attached file "1-King_moving_into_an_attack.png", there should be no suggested moves for the king.<br>
> 2. When in an absolute pin, there should be no move suggestions.  In the attached file "2-Stuck_in_absolute_pin.png", there should be no suggested moves for the bishop.  There are some other pin-related cases that are more complicated.<br>
> 3&4. When in check, the only valid moves of non-king pieces are to block or capture.  In the attached file "3_Only_move_absolute_pin.png", the only suggested move should be to block the queen's attack.  In the attached file "4-Only_move_capture.png", the only suggested move should be to capture the queen.<br>
><br>
> The program already knows that some of the suggestions are no good.  That is why it doesn't allow those moves and shows an error message instead.  I just want it to never show those bad suggestions in the first place.<br>
><br>
> On Fri, Jun 5, 2020 at 5:35 PM Tyson Williams <<a href="mailto:tyson.d.w@gmail.com" target="_blank" rel="noreferrer">tyson.d.w@gmail.com</a>> wrote:<br>
>><br>
>> Hello Johnny,<br>
>><br>
>> Thanks for the links.  I will take a look at them.<br>
>><br>
>> To help you and others better understand the cases, it just occurred to me that I could create and markup some screenshots.  I should be able to get those over the weekend.<br>
>><br>
>><br>
>> On Fri, Jun 5, 2020, 2:48 PM Johnny Jazeix <<a href="mailto:jazeix@gmail.com" target="_blank" rel="noreferrer">jazeix@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi Tyson,<br>
>>><br>
>>> thank you for your explanation. We are using the engine of p4wn<br>
>>> (<a href="https://github.com/douglasbagnall/p4wn" rel="noreferrer noreferrer" target="_blank">https://github.com/douglasbagnall/p4wn</a>) to power the chess activity.<br>
>>> There were already a few bug they fixed for "en passant":<br>
>>> <a href="https://github.com/douglasbagnall/p4wn/issues?q=is%3Aissue+is%3Aclosed" rel="noreferrer noreferrer" target="_blank">https://github.com/douglasbagnall/p4wn/issues?q=is%3Aissue+is%3Aclosed</a><br>
>>> but maybe that did not handle all the cases.<br>
>>><br>
>>> If you have knowledge, for sure these improvements are welcome!<br>
>>> If you can reproduce the bugs in <a href="http://p4wn.sourceforge.net/" rel="noreferrer noreferrer" target="_blank">http://p4wn.sourceforge.net/</a>, then it<br>
>>> would be better if this can be fixed upstream (proposing a pull<br>
>>> request) and we'll have to report on our code<br>
>>> (<a href="https://github.com/gcompris/GCompris-qt/blob/master/src/activities/chess/engine.js" rel="noreferrer noreferrer" target="_blank">https://github.com/gcompris/GCompris-qt/blob/master/src/activities/chess/engine.js</a>).<br>
>>> I can help you understand the code on GCompris, but will have more<br>
>>> difficulty to help on the engine.<br>
>>><br>
>>> I'll take a closer look tomorrow to try to understand more the<br>
>>> different use cases you are talking about.<br>
>>><br>
>>> Johnny<br>
>>><br>
>>> Le ven. 5 juin 2020 à 14:18, Tyson Williams <<a href="mailto:tyson.d.w@gmail.com" target="_blank" rel="noreferrer">tyson.d.w@gmail.com</a>> a écrit :<br>
>>> ><br>
>>> > !Hello everyone,<br>
>>> ><br>
>>> > 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.<br>
>>> ><br>
>>> > Anyway, there are two improvements that I would like to make to the chess activities.<br>
>>> ><br>
>>> > The first is that en passant is not a supported move.  I would like to add support for them.<br>
>>> ><br>
>>> > 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.<br>
>>> ><br>
>>> > Here are five cases in which only legal moves are suggested:<br>
>>> > - Opponent pieces in the way (e.g. if R on a1 can capture at a2, then capturing at a3 is not suggested)<br>
>>> > - Own piece in the way (e.g. there are no suggested moves for the king as the first move of the game)<br>
>>> > - 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)<br>
>>> > - 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)<br>
>>> > - 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)<br>
>>> ><br>
>>> > 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:<br>
>>> > - Suggestions are given to move the king to a square that is under attack.<br>
>>> > - Suggestions are given to move a piece that is absolutely pinned.<br>
>>> > - 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.<br>
>>> > - 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.<br>
>>> ><br>
>>> > If the user clicks such an illegal suggestion, the follow message is displayed.<br>
>>> > > "Invalid, your king may be in check"<br>
>>> ><br>
>>> > 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.<br>
>>> ><br>
>>> > 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.<br>
>>> ><br>
>>> > Would making en passant possible and removing illegal move suggestions be welcome changes to the chess activities?<br>
>>> ><br>
>>> > --<br>
>>> > Tyson Williams<br>
><br>
><br>
><br>
> --<br>
> Tyson Williams<br>
</blockquote></div>