Ludii Forum
Catchup scoring not correctly implemented - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Game Problems (https://ludii.games/forums/forumdisplay.php?fid=17)
+--- Thread: Catchup scoring not correctly implemented (/showthread.php?tid=2135)



Catchup scoring not correctly implemented - Michael - 03-14-2024

I have attached a trial of a random game that ended in a tie. This should not be possible in Catchup.
I can see that and argument is missing in the scoring macro in the end rules. It is:
Code:
(byScore {
    (score P1 ("LargestGroupCascading" P1))
    (score P2 ("LargestGroupCascading" P2))
})

But the definition expects two arguments:
Code:
(define "LargestGroupCascading"
    (max
        (intersection
            (difference
                (sizes Group #1)
                (sizes Group #2)
            )
            (sizes Group #1)
        )
    )        
)
I'm also pretty sure that this definition does not capture the scoring rule even when called with the appropriate arguments. For example, the difference between the array {1 1} and {1} is {}, not {1}. Edit: I was wrong about this. When testing it, I had inadvertently turned the array into a region, which removes duplicates. It seems to work fine when the missing argument is supplied :)


RE: Catchup scoring not correctly implemented - Michael - 03-15-2024

The intersection operation in the definition seems redundant. So here is the correct code:

Code:
// The definition:
(define "LargestGroupCascading"
    (max
        (difference
            (sizes Group #1)
            (sizes Group #2)
        )
    )         
)

// And the scoring:
(byScore {
    (score P1 ("LargestGroupCascading" P1 P2))
    (score P2 ("LargestGroupCascading" P2 P1))
})