Repository navigation
fix: checkout helper logic - #21
DaniilSyzenko wants to merge 5 commits into
Conversation
BySplashGm
left a comment
There was a problem hiding this comment.
Thanks for fixing the invalid sectors (D21, D22, D24 don't exist — those were real bugs).
The score_validator.dart cleanup is fine assuming isValidSector already guards against rawValue > 20, which it does.
Main concern: the new checkout suggestions for 2- and 3-dart finishes heavily favour starting on a Double (e.g. 62: ['D11', 'D20'], 66: ['D13', 'D20']). In practice, triples are easier to aim for than doubles — the segments are larger — so standard checkout charts always prioritise Triples as the first dart. For example:
- 62 →
T10, D16orT14, D10 - 66 →
T10, D18 - 81 →
T19, D12
The old code was closer to convention here, even if it had some invalid sectors. The fix should address the invalid sectors without changing the Triple-first logic.
Do you have unit tests covering CheckoutHelper? Given how many values changed, tests would help catch any arithmetic errors.
|
Hi, can I still work on this? |
|
Changed the checkout suggestions to favour triples just like on the standard checkout charts. There is now also a priority of hitting bigger numbers e.g. T20 T17 instead of T17 T20. Standard checkout tables also recomment hitting S10 D20 instead of Bull on 50, so the test covering this scenario was also modified. There is a new test to check whether the suggestion is arithmetically correct for every single checkout suggestion. It also covers impossible scores, so I combined it with other tests that check for impossible score scenarios. |
Changes checkout helper logic.