08-20-2020, 07:53 PM
(08-20-2020, 05:00 PM)dale walton Wrote: Can the connected chain include connectivity via the empty adjacent-to-occupied cells, but just not include them in the count, are they excluded from both connecting and being counted?Thank you so much, Dale! I meant "connected through a chain of orthogonal adjacencies between empty cells not adjacent to occupied cells". And the number of stones in the cell's line of sigh should be counted in the normal region which includes adjacent-to-occupied cells.
I figured out that I can get the right region like this: (difference (sites Empty) (sites Around (sites Occupied by:All) Orthogonal))
That looks like your second definition. It seems to work, but the real challenge seems to be to use this set of sites to define the relevantly connected set that each site belongs to.
I have not been able to test a way of counting the mover's stones in the cell's line of sight yet, but I'm looking for a way to test something like this: (count Pieces (Mover) in:(sites LineOfSight Piece at:(to)))
This might be gibberish, though.
I agree that this isn't the easiest place to start. And this is just half of the placement protocol.. But I'm trying to take things one step at a time. So far I have got the following up and running:
Code:
(game "Trivial"
(players 2)
(equipment
{
(board (square 8))
(piece "Ball" Each)
}
)
(rules
(play
(or
(move
Add
(to
(difference
(sites Empty)
(sites Around (sites Occupied by:All) Orthogonal)
)
)
(then (addScore Mover 1))
)
(pass)
)
)
(end
(if
(all Passed)
(byScore)
)
)
)
)