Drag and Drop Chess

John.

Object variable not set usually means that an error has already occurred.
The demo is still running with error handling turned off; it’s done that way to find the error and fix it.
No point in continuing after an error.

Can you run up to the point of it not doing what you think it should and export the game as a text file?
That way you can upload the text file and I can download it replay it.

Chris.
 
Sorry I get the Run Time error 76 "Path Not Found".

Are you not able to do anything with the excel files?
 
Surely you can import them into the moves table :confused:
 
Last edited:
It’s not built for Excel files, but I think I see one of the problems.

The default directory for export and import is in the table tblConfiguration in field BackupFolder.

As it stands it ships with my settings…

Try this; close and reopen the application.
Right click to open the Configuration Form and see if the default directory changes when you hit the 'Reset Default Backup' button and then hit the 'Accept Changes and Close button'.

Then open the Game and try to export it as file.

What version of Windows and Access are you using?

Chris.
 
John, I think the logic is correct.

The black Knight can not take the white Knight because the black King has resigned.

Manually step through the sequence...
White Knight places black King in check.
Black King resigns. (For whatever reason.)
Black Knight can not take white Knight because game is over.
(The Control Tip Text of the black Knight gives the reason.)

But I still have to fix the default directory thing. :o
Edit
And it does raise another 'Z' order thing with the Knights. :o


Chris.
 
Last edited:
Yes, John, that was the problem I saw in my previous post.

It’s either a ‘Z’ order problem with the Knights, as I originally stated, or a problem with the Pawns making a capture.

Thanks and regards,
Chris.
 
You’re not bad; you’re just too fast for me. ;)

I think it’s the Pawns; those little #%*#@ rascals that they are.

Chris.
 
...

I think it’s the Pawns; those little #%*#@ rascals that they are.

Chris.
kleinepause.4mal.de-schwarzer-rand-bilder-1-02.jpg
 
A new version, Version 4.3 2011-01-31, has been uploaded in post #1 in this thread.

Error handling is still turned off; we are still running in ‘crash mode’.

The PawnMoveToInvalidPosition() has been totally re-written, including its en passant section.
The Knight section of PieceMovePlacesKingInCheck() has been totally re-written.
(For the sake of my sanity it is now a subroutine which determines the validity.)

A SetDefaultDirectory subroutine has been added to the frmChess open event.
What this should mean is that if you get a front end from me, and the default directory in Null or is not valid on your machine, it will change the entry in table tblConfiguration field BackupFolder to your ‘My Documents’ directory or, if that fails, to C:\.
(Please post back any failures.)

I have left loaded the 11 worst test cases so far.
Each is named after the tester who produced it.
Each case runs up to, but not including, the point of error which required the test case to be written in the first place. Testing can continue by stepping to ‘Last’ after the test case is selected.

Regards,
Chris.
 
Chris, I realise this isn't really within the spirit of Chess, but an Undo button would make testing a little easier.
 
Yes, I do understand that request, it is a pain to go to the table and undo moves.

Tomorrow I’ll have a look at stopping the file update while testing.

I haven’t a clue as to what that might complicate or how to cut it in.

Regards,
Chris.
 
Okay, the save move in this version has been commented out.
Hopefully that makes it a bit easier to test.

Because it’s a faulty version I’ll post it here and delete it later.
The fully functional version is still in post #1.

Regards,
Chris.
 
Last edited:
Hi Chris. I must be doing something wrong, as I can't figure out how to undo a move whilst testing a new game :confused:
 
You can’t undo a move on a game; I just stopped the saving of changes.
I do not want those test games changed, they are there to allow the next move to be tested from the game’s endpoint but not change the game itself.

Something to try…
Use the version in post #1 to create the new game.
Run it up to some safe point and save it to text.
Import the saved game to the version in post #95.
Run your tests on that version.

Here’s the reason…
When playing live, a move does not necessarily generate only one record.
It would therefore be difficult to delete one move in the file because the context of the last move is not known.

Now I guess I could do a delete last record and then do a step to last record to see how it looks on screen, maybe.
But even if that works, and it might, there would need to be some place to initiate the sequence.
The immediate place, which comes to mind, is the shortcut menu.
But then it would need to ignore test cases, because I don’t want them changed.
So a game needs a locked field.
And provision needs to be made to lock/unlock it.
That provision also needs to be saved when exporting.
It also needs to be considered when importing.
Etcetera, etcetera, etcetera…

It’s complicated enough as it stands, so I’m reluctant to go down that path just for testing.
But, having said that, I might look at it tomorrow.

Chris.
 
A new version, Version 4.4 2011-02-03, has been uploaded in post #1 in this thread.

It fixes a bug when promoting to more than one Queen.

Faulty version removed from post #95.

Regards,
Chris.
 

Users who are viewing this thread

Back
Top Bottom