05-07-2023, 02:42 AM
I recently have been working on implementing another inventor's game based on LOS groups, and found a way to do this procedurally with (while) and marking processed pieces with states. but Ludii is both slow and difficult to script correctly using procedural approaches.
I would suggest having a way to find LOS groups, - or of counting Hops which is more generalized than counting steps perhaps. Or adding a new kind of (step LoS <siteType> (to) toPiece:<True = LoS Piece; False=LoS Farthest>) because hops are not normally variable distance.
eg does some think like the below work
...
Group
if:(and
(is In (to) (sites LineOfSight Piece at:(from)))
(= (who at:(to)) (who at:(from)))
)
would this work recursively???
----------------------------------
Or Distance measured in Hops instead of steps
Group
if:(and
(is In (to)
(sites Distance Hop // new parameter
(hop
(between (min 0))
(to
if:(and
(is In (to) (sites LineOfSight Piece)
(= (who at:(to)) (who at:(from)))
))
)
(min 0)
)))
(count Hops ... new parameter
---------------------------
(sites // or count, etc...
Group
at:<int> | from:<region>
if:(and
(is In (to)
(sites Distance Step
(step LoS (to if:(= (who at:(to)) (who at:(from))) toPiece:True) // new LoS keyword and toPiece parameter
(min 0)
))))
I think the new (step) method may be the best.
I would suggest having a way to find LOS groups, - or of counting Hops which is more generalized than counting steps perhaps. Or adding a new kind of (step LoS <siteType> (to) toPiece:<True = LoS Piece; False=LoS Farthest>) because hops are not normally variable distance.
eg does some think like the below work
...
Group
if:(and
(is In (to) (sites LineOfSight Piece at:(from)))
(= (who at:(to)) (who at:(from)))
)
would this work recursively???
----------------------------------
Or Distance measured in Hops instead of steps
Group
if:(and
(is In (to)
(sites Distance Hop // new parameter
(hop
(between (min 0))
(to
if:(and
(is In (to) (sites LineOfSight Piece)
(= (who at:(to)) (who at:(from)))
))
)
(min 0)
)))
(count Hops ... new parameter
---------------------------
(sites // or count, etc...
Group
at:<int> | from:<region>
if:(and
(is In (to)
(sites Distance Step
(step LoS (to if:(= (who at:(to)) (who at:(from))) toPiece:True) // new LoS keyword and toPiece parameter
(min 0)
))))
I think the new (step) method may be the best.