10-28-2020, 07:49 PM
Thank you, Eric!
Still, this does not give the expected result:
(I'm guessing I don't need to take the intersection with sites occupied by the player when using the if-parameter correctly, but I have left it in place.)
In the attached .lud, white has a 3-group and a 2-group, while black has two 2-groups. If both players pass white should win with 13 [9+4] points over black's 8 [4+4] points. What happens, though, is that white gets 25 and black 16. I don't get it. What am I doing wrong?
Still, this does not give the expected result:
Code:
(define "CalculateScore"
(and
(forEach Group Orthogonal
if:(or
(= (who at:(from)) P1)
(= (who at:(to)) P1)
)
(addScore P1
(*
(count Sites
in:(intersection (sites) (sites Occupied by:P1))
)
(count Sites
in:(intersection (sites) (sites Occupied by:P1))
)
)
)
)
(forEach Group Orthogonal
if:(or
(= (who at:(from)) P2)
(= (who at:(to)) P2)
)
(addScore P2
(*
(count Sites
in:(intersection (sites) (sites Occupied by:P2))
)
(count Sites
in:(intersection (sites) (sites Occupied by:P2))
)
)
)
)
)
)
In the attached .lud, white has a 3-group and a 2-group, while black has two 2-groups. If both players pass white should win with 13 [9+4] points over black's 8 [4+4] points. What happens, though, is that white gets 25 and black 16. I don't get it. What am I doing wrong?