01-07-2021, 10:43 AM
(01-06-2021, 07:50 AM)Eric Piette Wrote: Hi,
On the other thread I told you to put all the stuff related to all the pieces in the move generator of the piece in calling (forEach Piece) and everything which is more specific (so not related to ALL the pieces) not in the move generator.
So for your cases, a pass move or something for one single piece to replay in checking "SameTurn" that's not for all the pieces so that should not be in the move generator of a piece, but for a hop move for ALL the pieces that should be in the move generator of the piece.
You can not simply say I want to put everything in the play or everything in the move generator. Each part of the logic has a right place according to what you want them to do.
Regards,
Eric
Eric,
I have spent some time trying to think through what you are trying to tell me here. Eventually I think I worked it out and it seems to work.
This is a simplified account which ignores regions on the board and the different piece types. I am assuming that "MoveStep" is a macro that captures my needs for a step move and similarly for "moveHop". However I assuming that "moveHop" also takes an IntFunction as an optional parameter that restricts the (from) of the Hop to a single site containing a piece belonging to the Mover.
In the piece generator I need to specify the moves as:
Code:
(or
("MoveStep")
("MoveHop")
)
In the <play> section I need to have:
Code:
(if "SameTurn"
(or
("MoveHop" (last To))
(move Pass)
)
(forEach Piece)
)
As I said this seems to work.