Ludii Forum
Tie breaker rule for (byScore) - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: Tie breaker rule for (byScore) (/showthread.php?tid=116)



Tie breaker rule for (byScore) - ccxvii - 08-09-2020

I want to do something like the following to handle tie-breaking rules in scored games when the scores are equal.

(end
  (if ...)
  (byScore
    {
      (score P1 (count Pieces P1))
      (score P2 (count Pieces P2))
    }
    ifTied:(mover)
  )
)


RE: Tie breaker rule for (byScore) - Eric Piette - 08-09-2020

Hi,

With the current version, if you want to handle the 3 possibles cases (>, + and <) with specific results for some of them for the score (or any data like here in your example with the count of the pieces), you can do a sequence of 'If' tests for the different cases.

Something like


Code:
(end
   (if (....)
   {
      (if (> (score P1) (score P2)) (result P1 Win))
      (if (< (score P1) (score P2)) (result P2 Win))
   }
      (result Mover Win)
   )
)


Regards,
Eric Piette