Persistent position flags Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Desired Features for Zillions of Games » Persistent position flags « Previous Next »

Author Message
Patrick S. Duff (Pduff)
Posted on Thursday, October 26, 2000 - 6:12 am:   

I have to scan the board and set position flags at the beginning of every possible Lines of Action move.

Each time the position-flags are identical to the time before, since they depend upon the current board position, not on the particular move being considered. This situation probably occurs in other games too.

It would be much more efficient if I could set the position-flags just once, then have them persist while all of the possible moves from the current position are being considered.

Version 1.2.1 clears the position flags at the beginning of each move generation block inside the "(moves ...)". There should be a way to scope position-flags to the entire "(moves ...)" calculation when appropriate.
Karl Scherer (Karl)
Posted on Thursday, November 16, 2000 - 1:35 pm:   

Hi Patrick,

why don't you implement the flags as
permanent memory storages on the board?

You only need one pixel per storage:
(positions (S1 0 0 0 0)...)
Place an invisible
piece on it.
(many of my games use this methoid, see Nutts for example).
Fergus Duniho (Fduniho)
Posted on Friday, November 17, 2000 - 5:09 pm:   

I'm not sure I understand your solution, Karl, but I have one of my own, which might or might not be similar to yours. Create a shadow board by extending either the rows or columns with the grid statement. Unlink the shadow board from the regular board. It may be sufficient to unlink their borders. Alternately, create a shadow board using a set of dummy positions. These will automatically be unlinked and won't show up in the moves list. Use (links ) to create an individual link between each board position and its corresponding shadow board position. You can then place pieces on the shadow board to indicate changable features of the board. Using the direction that was used to link each board position to its own shadow board position, you can check the characteristics of that position.
Dan Troyka (Dtroyka)
Posted on Friday, November 17, 2000 - 6:17 pm:   

Probably the easiest way to create a shadow board would be to add a third dimension. This will create a duplicate board that can be placed at an arbitrary distance out of view. Then you only need to define one direction to have all board spaces linked to counterparts in the shadow board.

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: