| Author |
Message |
Ken Franklin (Kenz)
| | Posted on Tuesday, October 01, 2002 - 8:32 am: | |
I'm trying to add a piece? check(s) to standard chess moves. In this case, whether a Rook is on the same ROW. Adding the following to the front of 'Leap2' in chess: (or (piece? Rook e) (piece? Rook w) ) keeps giving me a parse error. It supposed to read (or (true/false?) (t/f?) (t/f?) ) then continue the move if one condition is true. The Current piece doesn't move over therefore I don't see why a From/Back would be used. Actually, the check is east only; e, e e, e e e, to check only if Rook is on far right column on the current piece's begining row! I'll use additional directions; e2 e3 e4, after I can understand the parse error. But I've re-attempted this pattern to many times at this point. Help. |
Dan Troyka (Dtroyka)
| | Posted on Wednesday, October 02, 2002 - 11:17 am: | |
Are you using "if" or "verify"? It should work to use (verify (or (piece? Rook e) (piece? Rook w))) at the start of the Leap2 macro. For the new directions do not use "e2", "e3", etc. because Zillions will confuse these with the positions e2, e3, etc. Also, the test you are describing would return true for any Rook to the right (not just the far right), which I understand would be an error. You could try using "while" to move to the far right to test whether a rook is there. For example, "(while (on-board? e) e) (verify (piece? Rook)) back" permits a move only if a Rook is in the far right position on the same row. Note that this test would prevent a non-Rook piece from moving if it is itself in the far right column. |
|