generated from mwc/lab_dice
Checkpoint 3: My experience working with OOP is that I understand most of it but is still a little confusing. I wasn't able to figure out all of the goals for the game. This is different than how I would have written the program in units 1 and 2 as I would have just made a bunch of functions and called them throughout my code. Now we can use classes.
26 lines
387 B
Python
26 lines
387 B
Python
from yahtzee import Yahtzee
|
|
from yahtzee_goals import (
|
|
GoalOnes,
|
|
GoalTwos,
|
|
GoalThrees,
|
|
GoalFours,
|
|
GoalFives,
|
|
GoalSixes,
|
|
GoalThreeofaKind,
|
|
GoalFourofaKind
|
|
)
|
|
|
|
goals = [
|
|
GoalOnes(),
|
|
GoalTwos(),
|
|
GoalThrees(),
|
|
GoalFours(),
|
|
GoalFives(),
|
|
GoalSixes(),
|
|
GoalThreeofaKind(),
|
|
GoalFourofaKind()
|
|
]
|
|
|
|
game = Yahtzee(goals)
|
|
game.play()
|