DEV Community

Tyler Wills
Tyler Wills

Posted on

Find 3 Dart average using JavaScript function

Im stuck on a particular thing. Im trying to calculate the 3 dart average i.e i start with a score of 501 and i hit 180 so after that score my average would be 180, then next throw i hit 100 so after 6 darts i have scored 280 so my 3 dart average would be 140, is there anyway i could use a function or something to calculate average over darts thrown given a score? The best average you can have is 167, start with 501. In 9 darts (3 Rounds) you score 180 - 180 - 141 then normally you could take 501 ÷ 9 (Darts thrown) then multiply by 3 (Rounds, each round you throw 3 darts) to give you a 3 dart average of 167. Thanks in Advance

Top comments (0)