| Author |
Message |
Jose Carrillo (J_carrillo_vii)
New member Username: J_carrillo_vii
Post Number: 1 Registered: 5-2008
| | Posted on Friday, May 23, 2008 - 9:37 pm: | |
Hello, I'm a rookie designing Zillion rules. I'm trying to develop the routine for the Bishop Adjustment Rule: http://www.chessvariants.org/index/msdisplay.php?itemid=MSthebishopadjus The move function below can be called with either E or W as the parameter, and will Adjust a Bishop (swap places) with any adjacent piece. Only ONE Bishop per side per game is allowed to swap places with an adjacent place. What I don't know how to do, is to change the 2nd Bishop (the one that I didn't adjust) so it no longer can adjust. Are there Global Variables in Zillions, so that I can setup a Bishop Adjustment flag and change it as soon as I adjust? Thanks for any help you can provide. === (define Bishop-Adjustment ( (verify never-moved?) (verify not-adjusted?) $1 ; N1 or M1 or Q1 (verify (and friend? never-moved?) ) cascade (set-attribute not-adjusted? false) (set-attribute never-moved? false) from $1 ; N1 or M1 or Q1 (set-attribute not-adjusted? false) (set-attribute never-moved? false) back ; B1 to add ) ) |
Jose Carrillo (J_carrillo_vii)
New member Username: J_carrillo_vii
Post Number: 2 Registered: 5-2008
| | Posted on Friday, May 23, 2008 - 9:41 pm: | |
One thing I forgot to say, the rule should be general enough to apply to any size board [8x8, 9x9 & 10x8) |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 74 Registered: 1-2007
| | Posted on Saturday, May 24, 2008 - 5:51 am: | |
Set-attribute is perfect. You must set attribute at the position where it will be located when you make add. /Mats |
Jose Carrillo (J_carrillo_vii)
New member Username: J_carrillo_vii
Post Number: 3 Registered: 5-2008
| | Posted on Saturday, May 24, 2008 - 9:20 am: | |
Yes, but how do I go about changing the second Bishop's attribute? This code will do the Bishop swap, and will flag the first Bishop preventing it from Adjusting again. The one I'm having trouble with is changing the 2nd Bishop's attribute, as I don't want it to be able to adjust after one Bishop has already adjusted. After completing the swap of the first Bishop, how do I go to the a1 square, and turn the set-attribute flag for ALL the pieces (a1 to h1, ii or j1) to "not-adjusted? false" |
Jose Carrillo (J_carrillo_vii)
New member Username: J_carrillo_vii
Post Number: 4 Registered: 5-2008
| | Posted on Saturday, May 24, 2008 - 1:34 pm: | |
Is there a debug mode in Zillions where I can see the value of the different attributes, the current position, and the queue moves? |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 75 Registered: 1-2007
| | Posted on Saturday, May 24, 2008 - 2:17 pm: | |
I don't know. Try another solution, then, e.g. (create Bishop_) at the swapped position. The "Bishop_" always has the attribute set to false (unlike Bishop). Otherwise they are the same. You can set notation to "Bishop" so the underscore isn't visible. /Mats |
Alfred Pfeiffer (Apf)
New member Username: Apf
Post Number: 13 Registered: 7-2000
| | Posted on Sunday, May 25, 2008 - 7:58 pm: | |
Use a dummy position (for each player) as a global flag for the bishop adjustment. If you let this position empty in the setup, then you should place with the Bishop adjustment a dummy piece to this position; and at the beginning of the adjustment routine you could check simply whether this position is still empty. Alfred Pfeiffer |
Jose Carrillo (J_carrillo_vii)
New member Username: J_carrillo_vii
Post Number: 5 Registered: 5-2008
| | Posted on Sunday, May 25, 2008 - 8:07 pm: | |
That's a great idea worth exploring! Thanks! Jose |