Example #1
0
 def test_two_pairs(self):
     hand = YatzyHand()
     hand[:] = [
         self.dice[1], self.dice[0], self.dice[0], self.dice[3],
         self.dice[3]
     ]
     self.assertEqual(self.scoresheet.score_two_pairs(hand), 10)
Example #2
0
def main():
    hand = YatzyHand()
    three = D6(value=3)
    four = D6(value=4)
    one = D6(value=1)
    hand[:] = [one, three, three, four, four]
    print(YatzyScoresheet().score_one_pair(hand))
Example #3
0
 def test_four_of_a_kind(self):
     hand = YatzyHand()
     hand[:] = self._seed([2, 2, 2, 2, 5])
     self.assertEqual(self.scoresheet.score_four_of_a_kind(hand), 8)
Example #4
0
 def test_three_of_a_kind(self):
     hand = YatzyHand()
     hand[:] = self._seed([2, 2, 2, 4, 5])
     self.assertEqual(self.scoresheet.score_three_of_a_kind(hand), 6)
Example #5
0
 def test_two_pairs_no_pairs(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_two_pairs(hand), 0)
Example #6
0
 def test_yatzy(self):
     hand = YatzyHand()
     hand[:] = self._seed([2, 2, 2, 2, 2])
     self.assertEqual(self.scoresheet.score_yatzy(hand), 50)
Example #7
0
 def test_sixes(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_sixes(hand), 6)
Example #8
0
from hands import YatzyHand
from dice import D6
from scoresheets import YatzyScoresheet
hand = YatzyHand()
three = D6(value=3)
four = D6(value=4)
one = D6(value=1)
hand[:] = [one, three, three, four, four]
pr = YatzyScoresheet().score_one_pair(hand)
print(pr)
Example #9
0
 def test_chance(self):
     hand = YatzyHand()
     hand[:] = self._seed([4, 3, 3, 2, 1])
     self.assertEqual(self.scoresheet.score_chance(hand), 13)
Example #10
0
 def test_fives(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_fives(hand), 5)
Example #11
0
 def test_full_house(self):
     hand = YatzyHand()
     hand[:] = self._seed([2, 2, 5, 5, 5])
     self.assertEqual(self.scoresheet.score_full_house(hand), 19)
Example #12
0
 def test_large_straight(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_large_straight(hand), 20)
Example #13
0
 def test_small_straight(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_small_straight(hand), 15)
Example #14
0
import dice, hands
from hands import YatzyHand

hand = hands.Hand(size=5, die_class=dice.D6)
yh = YatzyHand()
Example #15
0
 def test_one_pair(self):
     hand = YatzyHand()
     hand[:] = [self.dice[0], self.dice[0], self.dice[3]]
     self.assertEqual(self.scoresheet.score_one_pair(hand), 2)
from hands import YatzyHand
from dice import D6
from scoresheets import YatzyScoresheet

monopoly = YatzyHand()
d1 = D6(value=4)
d2 = D6(value=5)
monopoly[:] = [d1, d2]

print(monopoly)
print(monopoly.doubles)
Example #17
0
 def test_one_pair_no_pairs(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_one_pair(hand), 0)
Example #18
0
 def __init__(self, hand = YatzyHand()):
     self.hand = hand
Example #19
0
 def roll(self):
     self.hand = YatzyHand()
     return