lab_dice/test_goals.py

35 lines
865 B
Python

from die import Die
from yahtzee_goals import ThreeOfAKind
from yahtzee_goals import FourOfAKind
from yahtzee_goals import FullHouse
from yahtzee_goals import SmallStraight
from yahtzee_goals import LargeStraight
from yahtzee_goals import Chance
from yahtzee_goals import Yahtzee
def makeDice(faces):
dice = []
for face in faces:
die = Die()
die.face = face
dice.append(die)
return dice
three = makeDice([1,1,1,3,4])
four = makeDice([1,2,4,4,4])
full = makeDice([3,3,5,6,6])
sstraight = makeDice([1,3,5,5,6])
lstraight = makeDice([1,2,3,4,5])
chance = makeDice([2,2,3,4,6])
yahtzee = makeDice([1,4,4,4,4])
goalThree = ThreeOfAKind()
goalFour = FourOfAKind()
goalFull = FullHouse()
goalSstraight = SmallStraight()
goalLstraight = LargeStraight()
goalChance = Chance()
goalYahtzee = Yahtzee()
print(goalYahtzee.score(yahtzee))