generated from mwc/lab_dice
I'm not sure if I underdtood it correctly. But, I found that it broke down a large piece of code into smaller pices like a code for dice, goals, and the game. Additionally, it also made it easier to test and change codes if needed.
18 lines
234 B
Python
18 lines
234 B
Python
from yahtzee import Yahtzee
|
|
from yahtzee_goals import (
|
|
GoalOnes,
|
|
GoalTwos,
|
|
GoalThrees,
|
|
GoalFours
|
|
)
|
|
|
|
goals = [
|
|
GoalOnes(),
|
|
GoalTwos(),
|
|
GoalThrees(),
|
|
GoalFours(),
|
|
]
|
|
|
|
game = Yahtzee(goals)
|
|
game.play()
|