Notes to Michael

by

> LegalMove needs access to the following input data:
> - the move in the form of a string parameter
> - the board in the form of a shared array
> - whose turn it is in the form of a shared variable. (if this should be a parameter, I can live with that.)

Whose turn it is? Suppose the move is e5-e7. Then e5 identifies a square and if the value is 2 it is a Queen and if it is -2 then it is the opponent Queen. So obviously, if the square is negative, it is black's move. But in a way, who cares? It is sort of symmetrical. A negative piece can't take a negative piece, etc.

> LegalMove also needs access to a second, virtual board called vboard. > This is not used to store data between calls to LegalMove

good, then it can be defined within LegalMove, right?

>but is used ... for passing data to IsThreatened.

Well, OK. I changed the driver to include vBoard so you don't have to pass an additional parameter.

> As to the unexpected results...
> This seems to be because of a misunderstanding...
> I assumed that the Board dimensions were in the form of x+1,y+1, but they seem to be coded in the driver in the form of y+1,x+1. Was this a mistake, or did you intend to swap the x and y axes? If the latter, I can swap the axes in my code, but I suspect this was a mistake.

Not a mistake. Actually your comment "I assumed" reminds me of problems with large projects. The key is to never assume anything. All things must be documented. In this case, the documentation is in the driver's design. The coordinates chosen, whether by random or after careful consideration, are used by all components (display, data entry, etc.).

That is why it is important to run with a completely unmodified driver.

Glad the problem was that easy to spot! Nice work!.

Please use the new driver and I will delete the old driver thread when you are ready.

Mac

Posted on Dec 22, 2005, 7:48 AM
from IP address 68.98.164.60

Respond to this message   

Return to Index


Response TitleAuthor and Date
okay on Dec 22
 Michael - You were right! EMERGENCY on Dec 22
  well on Dec 22
   Whew! Thanks. New Driver here on Dec 22
    updated code on Dec 22
     Making progress :-) on Dec 22
      Started new thread on Dec 23