Python Object-Oriented Python Dice Roller Yatzy Scoring

William Shaylor
William Shaylor
2,974 Points

For YatzyScoresheet isn't it better to pass in property of a hand, instead of making method for each number list?

Why do we get asked to make a method for each property of hand? So score_ones, score_twos, score_threes, etc. So we need a separate method for hand.ones, hand.twos, hand.threes, etc..

Isn't it better to create just one method that accepts the properties of hand as arguments, and sums them instead? So instead of just passing 'hand' as an argument, we could for example pass in 'hand.fours' or 'hand.twos'. The way we're told to code it surely breaks the DRY rule?

1 Answer

Jebadeiah Jones
Jebadeiah Jones
10,369 Points

This is kinda tough when going back, but I suspect it's simply because they hadn't covered something at this point, specifically ranges.