For each of the 13 rows of a Yahtzee scoresheet you are given (from stdin) a space separated list of 5 numbers (dice). Your task is to calculate the score for each line and output the Grand Total of the game.
Example
Input and how to interpret it:
Input Box Score
6 1 4 1 3 Aces 2
3 2 2 1 2 Twos 6
6 3 2 3 3 Threes 9
4 2 3 6 5 Fours 4
6 3 5 5 1 Fives 10
1 5 6 5 6 Sixes 12
Bonus -
4 2 4 4 1 3 of a kind 15
2 2 3 2 4 4 of a kind -
3 2 2 2 3 Full house 25
1 3 1 6 1 Small straight -
2 5 4 6 3 Large straight 40
2 2 2 2 2 Yahtzee 50
5 5 4 5 2 Chance 21
Grand Total 194
We will disregard the Yahtzee Bonus and Joker rules, and only sum up the scores from the Upper and Lower Section and the Bonus in the Upper Section. If in doubt, refer to these rules.
May the shortest code win!