コード例 #1
0
ファイル: GamePlayMethods.py プロジェクト: syc9/Hearts
 def passCardsAuto():
     return Automate.passCard(self)
コード例 #2
0
ファイル: GamePlayMethods.py プロジェクト: syc9/Hearts
    def playCardAuto(self, sofar):

        auto = Automate()
        return auto.playCard(self, sofar)
コード例 #3
0
	def passCardsAuto():
		auto = Automate();
		return auto.passCard(self)
コード例 #4
0
	def playCardAuto(self, sofar):

		auto = Automate();
		return auto.playCard(self, sofar);
コード例 #5
0
 def passCardsAuto():
     auto = Automate()
     return auto.passCard(self)
コード例 #6
0
for i in range(13):
    #check on the first hand only
    if (i == 0):
        for k in range(4):
            if Players[k].hasTwoOfClubs:
                turn = k
                break

    #check what has been played so far
    sofar = []
    point_total = 0
    #each person plays a card (and loops through turn)
    for m in range(4):
        print str(turn) + " " + str(Players[turn].hand)
        card = Players[turn].playCardAuto(sofar)
        sofar.append(card)
        turn = (turn + 1) % 4
        point_total += CardClass.pointValue(card)
    turn = CardClass.winner(sofar)  #indicate who wins the trick
    Players[turn].points += point_total

    print sofar

auto = Automate()
player = GamePlayMethods.Player()
hand = [1, 6, 10, 14, 29, 32, 39, 41, 42, 43, 45, 46, 47]
sofar = [0, 2, 11]
player.setHand(hand)
print auto.playCard(player, sofar)