Re-create the scoring system from Ten Pin Bowling in JavaScript