RT我们原题是writethegameplayingmoduleinpython怎么把它弄成一个loop?我现在是选T后就结束了.#~askplayersactionwhileTrue:player_action=str(raw_input("twist(t)orstick(s)?"))#~i...
RT
我们原题是write the game playing module in python
怎么把它弄成一个loop?我现在是选T后就结束了.
#~ ask players action
while True:
player_action = str(raw_input("twist (t) or stick (s)?"))
#~ if player chooses twist
if player_action == "t" :
#~ player is delt with one more card
player_card3 = realDealCard()
#~ show player the third card
print "your card3 is", cardAsString(player_card3)
#~ count current score of player
player_score += cardScore(player_card3)
#~ show player current score
print "your score is", player_score
#~ check bust
#~ if current score of player > 21
if player_score > 21 :
#~ bust
print "you bust"
#~ player lose
print "you lose and computer wins"
#~ elif current score of player == 21
elif player_score == 21 :
#~player has a blackjack
print "blackjack!"
#~win
print "you win and computer loses"
elif player_score <21
while true
展开