Dynamic zones Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Desired Features for Zillions of Games » Dynamic zones « Previous Next »

Author Message
Patrick S. Duff (Pduff)
Posted on Thursday, May 17, 2001 - 8:33 am:   

Several of my rules files would be much simpler and faster if I could make more use of zones. The problem is that zones are not dynamic. I presume that zones are stored in memory as a simple list of positions. I want the following new commands to work during move generation:

(add-to-zone [zone-name] [position1] ... [positionN])
(remove-from-zone [zone-name] [position1] ... [positionN])
(copy-zone [zone-name1] [zone-name2])

During move generation only a player's own zones would be modified. All changes to a zone would be made in a temporary copy of the zone which is local to the move-generation block; only the move which actually gets selected would result in changes to the global copy of the zone.

All changes to the global zones would be cumulative from one turn to the next. So if a turn adds or removes a position to a zone, subsequent turns would get the modified zone.

If you don't want cumulative changes, copy [zone-name1] to [zone-name2] at the beginning of the move-generation block, then only make changes to [zone-name2].

To start move-generation with an empty zone, it would be nice if one could define empty zones under "(board ...)". But without making that syntax change, one could create a zone with a dummy position, then remove the dummy position during move generation to get an empty zone (or just ignore the dummy position during move generation).
Jeff Mallett (Jeffm)
Posted on Wednesday, August 13, 2003 - 6:35 pm:   

>I presume that zones are stored in memory as a simple list of positions

Just FYI, they aren't. That would be an O(n) lookup, whereas Zillions tests for zones in constant time.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: