Drag and Drop Chess

Hi Chris, that makes sense.

The attachment in my post #38 contains a Work '07 doc, you may need to download the compatibility pack if you don't already have it.
 
Chris, I've also found that the Black King's square will change to red when he is under threat, however the same does not happen for the white king.
 
Ok, the failure was possible for either King in a corner.

The not showing check was due to the Z order when a piece captures another piece.
At that time there are two pieces on the same square and it depends on the Z order which one would be tested for checking.

Version 3.1 has been uploaded and hopefully fixes both problems. ;)

Regards,
Chris.
 
Hi stopher, looking good.

It recognises En passant to be a legal move but the captured enemy pawn remains in play.
Thanks. Yes the code I wrote only validates (which was the requirement). It does not update the visual board.

Regards
Chris
 
Yes testing is challenging.

Here's some comments:
- when the g1 square is attacked by black and white attempts king side castling, the king is prevented from moving but the rook still moves

- when the f1 square is attacked by black, castling kingside by white is not prevented

- the king is allowed to castle out of check

- kings are able to move next to each other

- when the king is in check by a pawn on 5th rank and en passant captures the pawn, the move is not allowed (presumably because the code thinks the king is still in check.

- when moving a pawn capture to the 8th rank, I was not offered a new piece (not sure if you've done this yet).

- I'm experiencing a lag when dropping the piece - maybe due to the string calculations? My laptop is a bit slow though :o
 
Thanks. Yes the code I wrote only validates (which was the requirement). It does not update the visual board.

Regards
Chris

Thanks for the clarification, I wasn't sure how far you where taking your code :)
 
G’day Chris.

A new version, Version 3.2 2011-01-23, has been uploaded in post #1 in this thread.

Thanks for the testing; I know how hard it is…

- when the g1 square is attacked by black and white attempts king side castling, the king is prevented from moving but the rook still moves
Current status: fixed, I hope.

- the king is allowed to castle out of check
Current status: fixed, I hope.

- kings are able to move next to each other
Current status: fixed, I hope.

- when the king is in check by a pawn on 5th rank and en passant captures the pawn, the move is not allowed (presumably because the code thinks the king is still in check.
Current status: fixed, I hope.

- when moving a pawn capture to the 8th rank, I was not offered a new piece (not sure if you've done this yet).
Current status: fixed, I hope.

- when the f1 square is attacked by black, castling kingside by white is not prevented
Current status: work in progress.

- I'm experiencing a lag when dropping the piece - maybe due to the string calculations? My laptop is a bit slow though
Current status: stop using a Babbage machine. :D
Seriously though, a replay of a game will hit the processor at around 50% loading.

Thanks again to you and John for the testing; I do know how much time it takes.
I guess you and John have already figured it out but in case you haven’t…
If in running a game, and a programming indiscretion occurs (okay bug if you must :o ), then a trip to the tblGameMoves table will allow the undo of the last ‘X’ moves by deleting the last ‘X’ records. You can then open the frmChess Form again, select the game, and hit the last button. That will take you to the last record not deleted and you can then resume manual play at or before the point of error.

If you so desire both you can PM me and I will send you my email address. You can then save a game (right click on board) as an attachment and send it to me. That way I will know exactly what moves lead up to an error. I will ignore requests for my email address from anyone apart from those who have publically contributed to the testing. So if anyone else would like to do so, apart from John and Chris who have already done so, then please post some testing bugs publically and I’ll see what I can do.

Thanks again for the testing…
Regards,
Chris.
 
- I'm experiencing a lag when dropping the piece - maybe due to the string calculations? My laptop is a bit slow though
Current status: stop using a Babbage machine. :D
Seriously though, a replay of a game will hit the processor at around 50% loading.
I'm upgrading to a Commadore PET next weekend :D
 
:D

Validation of King through check while Castling coming up in the next half hour.

Hopefully…

Regards,
Chris.
 
A new version, Version 3.3 2011-01-23, has been uploaded in post #1 in this thread.

Validation of King through check while Castling.

Regards,
Chris.
 
There still seems to be a problem when the king is in check. Moves attached (using your export tool :))

But I think you're almost there...
 

Attachments

Just to add...

When a king is in check, it seems ANY OTHER piece piece can be moved i.e. ignoring the check entirely. Same goes for both colours.
 
A new version, Version 3.4 2011-01-24, has been uploaded in post #1 in this thread.

Fixed the moves not seeing the King in check.
Oddly enough that was broken for some time. It worked on the second move after the King was in check but not the first. The reason was that the King was placed in check after the test was made and the search was looking for a piece marked as the checking piece.

Hope all is well now and thanks again for the time you are putting into the testing.
(You now have your name in the Form’s caption, if that is alright??? :) )

Oh, and the export import worked fine.

Regards,
Chris.
 
No, still not right, leave it with me… :(

Chris.
 
A new version, Version 3.5 2011-01-24, has been uploaded in post #1 in this thread.

Regards,
Chris.
 
It's getting tough to find them but here's another prob ;)

When promoting a pawn to a knight that puts the opps king in check, the opp can make any move i.e. still remain in check. See attached.
 

Attachments

Double check problem

When double checking, only one of the checks seems to be recognised. When the recognised check is dealt with e.g. by capture, the other piece is still checking. See attached.
 

Attachments

A new version, Version 3.6 2011-01-24, has been uploaded in post #1 in this thread.

Promoting a pawn to a knight has been fixed, hopefully.
There was also another ‘Z’ order problem which I believe is also fixed.

The double check is still work in progress and I don’t think I’ll get it fixed in the next 12 hours.

These faulty games you are sending me are a great help. I’m not deleting any off my computer because sometimes a fix may reinstate an old bug. Eventually we should be able to run all the ‘faulty’ games without error.

Thanks again for the testing,
Chris.
 
A new version, Version 3.7 2011-01-25, has been uploaded in post #1 in this thread.

Double checking seems to be working okay but it does slow things down a little.
It was only doing a test for check and, if found, bailed out of the routine. Now it continues on and marks all checks found. I have only tested it for two checks because I don’t know if it would be possible to have three checks; did I mention I don’t play Chess? :D

I’ve placed another entry on the shortcut menu which allows exporting the game just to a file without the email. I assume when you uploaded a game you dumped it to email and then saved the attachment. Now it just dumps the game to the default directory.

I think we are getting close… :)


Edit:
As a test of the double check I’ve uploaded your double check game.
Next to play: E5 to G6.
Black should only be allowed to move the King to one of three squares.

Regards,
Chris.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom