Open jsyiek opened 2 weeks ago
If using attempt tracking, could have a third variable (attempts) to add a way of doing lent24 attempt points.
+ min(2, attempts//3)
If using attempt tracking, could have a third variable (attempts) to add a way of doing lent24 attempt points.
+ min(2, attempts//3)
I like the idea of including attempts. I might just include the // operator and the attempts variable though.
Note: Only take this ticket if you experience in context-free grammars.
Problem: Umpires write different scoring formulae for open season each game. This has been done directly in a Python script, and while we could
eval
umpire code (what could go wrong?) I'd like to do this properly.Requirements: A set of library code to (1) parse arbitrary arithmetic expressions (+ - / * ^) (2) recognize two dedicated variables (kills, conkers), (3) recognize arbitrary FP numbers (1.249, 581.2, etc.), and (4) to evaluate a parsed formula given the real values of kills and conkers. There are various CFGs online for this type of language (as a starting point, you could even use my Parallang grammar, but it doesn't support exponentiation). You should use pyparsing or equivalent.