thewca / wca-live

Platform for running WCA competitions and sharing live results with the world
https://live.worldcubeassociation.org
70 stars 23 forks source link

Added checks for regulation 9m #215

Open mckeenicholas opened 7 months ago

mckeenicholas commented 7 months ago

Closes #186

I've only implemented the check on the server side as of now. I can add a client side check as well if necessary.

OldManLink commented 7 months ago

There are still grammar mistakes, BTW: "rounds with less than N competitors..." should be "with fewer than N competitors..."

Also, just a suggestion, why not use the actual rule text which is subtly different, even if semantically the same as yours:

9m1) Rounds with 99 or fewer competitors must have at most two subsequent rounds.
9m2) Rounds with 15 or fewer competitors must have at most one subsequent round.
9m3) Rounds with 7 or fewer competitors must not have subsequent rounds.
mckeenicholas commented 7 months ago

I've updated the text to use the regulation text. The original code had a check for having at least 8 competitors in the previous round which was formatted in the same way I wrote them, which was my reasoning for keeping it in the same format. (I also find "fewer than 100" more understandable than "99 or fewer", but its probably better to use the actual regulation text).

jonatanklosko commented 7 months ago

@mckeenicholas thanks, a couple small comments. Also, please add one more test similar to this one:

https://github.com/thewca/wca-live/blob/66b1ab6e0d78617ce957d94725a4994aaa0efa71/test/wca_live/scoretaking_test.exs#L524-L534