| Author |
Message |
Matthew Burke (Morat)
| | Posted on Sunday, December 15, 2002 - 7:28 pm: | |
I've found a work-around, so this isn't pressing, but I am developing a game where the turn order is
(turn-order (White Neutral) (Black Neutral)) and have found that the standard technique for determining whose turn it is---by using in-zone? and not-in-zone?---doesn't work. It turns out that am-white? is always true and am-black? is always false (or vice versa, I don't remember) and this surprised me. Maybe it shouldn't have. The other thing I tried which didn't work was to create a dummy board position and putting a dummy piece owned by white on it. I then used friend? and enemy? to create am-white? and am-black? macros. But regardless as to whose turn it was, am-white? was always false and am-black? was always true. Again this doesn't seem right to me. For the curious, what does work is that I put a Neutral piece of type WhiteDummyPiece on the dummy square and then at the end of the move change it to a Neutral piece of type BlackDummyPiece, etc. |
Karl Scherer (Karl)
| | Posted on Saturday, January 18, 2003 - 3:45 pm: | |
A simple method I have used in such cases is to store a piece on an invisible (or dummy) position z0 to mark whose turn it is next: During White's move, change it to "White-Mark", during Black's move, change it to "Black-Mark", where White-Mark and Black-Mark are dummy pieces. Then check (if (piece? White-Mark? z0)... etc |
|