コード例 #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)
コード例 #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))
コード例 #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)
コード例 #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)
コード例 #5
0
 def test_two_pairs_no_pairs(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_two_pairs(hand), 0)
コード例 #6
0
 def test_yatzy(self):
     hand = YatzyHand()
     hand[:] = self._seed([2, 2, 2, 2, 2])
     self.assertEqual(self.scoresheet.score_yatzy(hand), 50)
コード例 #7
0
 def test_sixes(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_sixes(hand), 6)
コード例 #8
0
ファイル: script.py プロジェクト: alanmynah/Practice
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)
コード例 #9
0
 def test_chance(self):
     hand = YatzyHand()
     hand[:] = self._seed([4, 3, 3, 2, 1])
     self.assertEqual(self.scoresheet.score_chance(hand), 13)
コード例 #10
0
 def test_fives(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_fives(hand), 5)
コード例 #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)
コード例 #12
0
 def test_large_straight(self):
     hand = YatzyHand()
     hand[:] = self.dice[1:]
     self.assertEqual(self.scoresheet.score_large_straight(hand), 20)
コード例 #13
0
 def test_small_straight(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_small_straight(hand), 15)
コード例 #14
0
import dice, hands
from hands import YatzyHand

hand = hands.Hand(size=5, die_class=dice.D6)
yh = YatzyHand()
コード例 #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)
コード例 #16
0
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)
コード例 #17
0
 def test_one_pair_no_pairs(self):
     hand = YatzyHand()
     hand[:] = self.dice[:5]
     self.assertEqual(self.scoresheet.score_one_pair(hand), 0)
コード例 #18
0
ファイル: scoresheets.py プロジェクト: shapedup/yatzy
 def __init__(self, hand = YatzyHand()):
     self.hand = hand
コード例 #19
0
ファイル: players.py プロジェクト: zstearman3/yatzy
 def roll(self):
     self.hand = YatzyHand()
     return