| Author |
Message |
Michael Strickland (Michael)
| | Posted on Monday, July 14, 2003 - 10:49 pm: | |
I am trying to script a piece that reduces the range of movement of pieces to a single step. When passing through or starting from the eight squares immediately adjacent to this piece's position, friendly or hostile pieces are reduced to step-movers, i.e., a version of their original type of movement but limited to one square. E.g., a queen would be reduced to the movement of a king, a bishop to the move of a fers, a knight would be immobilized, etc. Is this something that Zillions can actually be instructed to do? Any suggestions how to implement this, or are there similar pieces that I have overlooked whose macros might be instructive in resolving my problem? I had thought that the immobilizer in Maxima might have been a likely piece to study for scripting solutions, but, thus far, I have not been successful. The game in which this piece is used is a large historic variant of the chess that was native to Mongolia, shatar. This enlarged version is called Hiashatar, (hia=bodyguard) after the new piece added to the array of pieces in the smaller form. |
John Kewley (Jkew)
| | Posted on Thursday, July 17, 2003 - 7:08 pm: | |
Is it only at the start of a player's move that the piece has reduced mobility, or is it also affected if it comes 'within range'. I have had a look at implementing this game too, the trickier part would be the rules surrounding checkmate which are as in normal Shatar and place restrictions on which pieces can mate depending on other pieces used in a forcing sequence. I reckon it is doable with a couple of flags and a liberal sprinkling of calls to check, set and reset them, but it is not trivial. |
Michael Strickland (Michael)
| | Posted on Friday, July 18, 2003 - 12:06 pm: | |
As I understand from the page linked to Chessvariants.com, the bodyguard affects any piece's movement that begins, ends, or would pass through the zone of influence of the bodyguard, the eight squares immediately adjacent to the square where the bodyguard sits. The piece's mobility is reduced as described in my earlier posting. That was why, for example, I want to view the move of the knight as one step orthogonally and one diagonally, since its movement (already restricted severely by the influence of the bodyguard) could recover some mobility around this zone. While Hiashatar has some of the check restrictions that are found in shatar, they seem to be far fewer. In this game, it seems that only the bodyguard may not check (or checkmate), but it is, as you describe, a significant scripting dilemma to resolve. |
Jeff Mallett (Jeffm)
| | Posted on Sunday, July 20, 2003 - 12:26 pm: | |
Checking whether you are adjacent to a bodyguard should be simple:
(define restriction-check (verify (and (not-piece? bodyguard n) (not-piece? bodyguard ne) (not-piece? bodyguard e) (not-piece? bodyguard se) (not-piece? bodyguard s) (not-piece? bodyguard sw) (not-piece? bodyguard w) (not-piece? bodyguard nw))) )
You should be able to use this in the move generation of other pieces. For example, to restrict the movement of a sliding piece, you could do something like this (untested) code:
(define slide $1 (while empty? add (restriction-check) $1) (verify not-friend?) add )
|
Michael Strickland (Michael)
| | Posted on Sunday, July 20, 2003 - 6:47 pm: | |
Thanks! I have the zrf up and running now. |
|