| Author |
Message |
Cameron Browne (Camb)
| | Posted on Friday, July 25, 2003 - 4:52 pm: | |
Hi, How do I determine whether the last move was a drop or a move? The FAQ says that last-from? will return "Nothing" if it was a drop. However it seems to me this cannot actually be tested without terminating the current move block. Thanks, Cameron |
Cameron Browne (Camb)
| | Posted on Friday, July 25, 2003 - 4:59 pm: | |
My mistake, (if last-from? ...) does indeed appear to work without terminating the current move block. |
Cameron Browne (Camb)
| | Posted on Tuesday, July 29, 2003 - 3:57 am: | |
Is there a way to determine whether Black or White owns a particular piece on the board, or do I have to define separate sets of pieces for each player? Note that a ?Random player is making the enquiry, so "friend?" and "enemy?" are no use. |
Karl Scherer (Karl)
| | Posted on Wednesday, July 30, 2003 - 4:51 pm: | |
I am not sure, but maybe (?Random Player1 Inquiry) works, where ?Random plays for Player1, hence can use the friend? command. |
Karl Scherer (Karl)
| | Posted on Wednesday, July 30, 2003 - 5:00 pm: | |
You can also identify who owns what, by defining attributes "PlayerA?" "PlayerB?" "PlayerC?" etc. and then make sure the correct attribute is set for each piece at the start of the game. However, using attributes can become a big hazzle in more complex programs because you always have to update them manually. E.g., "flip" and "change-owner" can confuse things, as they do not alter these atributes. Also, you have to set the attribute after each "create" command and so on. There is no way to automatically harmonize the attribute with real ownership of pieces. |
|