generated from mwc/lab_dice
Checkpoint 3: I think in Units 1 or 2 I wouldn't have had such specific conditions. So OOP helps me target specific goals or problems that I might encounter. I think OOP makes more sense to me than other targeted code we wrote in Unit 1 or 2. I am struggling a little bit to understand creation of "." conditions/actions. Otherwise this seems to be a super useful tool to know.
20 lines
274 B
Python
20 lines
274 B
Python
from yahtzee import Yahtzee
|
|
from yahtzee_goals import (
|
|
GoalOnes,
|
|
GoalTwos,
|
|
GoalThrees,
|
|
GoalFours,
|
|
LargeStraight
|
|
)
|
|
|
|
goals = [
|
|
GoalOnes(),
|
|
GoalTwos(),
|
|
GoalThrees(),
|
|
GoalFours(),
|
|
LargeStraight(),
|
|
]
|
|
|
|
game = Yahtzee(goals)
|
|
game.play()
|