Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Problem #4: Playing a hand
- #
- def play_hand(hand, word_list):
- display_hand(hand)
- word = str(raw_input("Enter a word or . to finish"))
- score=0
- if word == ".":
- return score
- validity = is_valid_word(word,hand,word_list)
- if validity == False:
- print "choose another word"
- score += play_hand(hand,word_list)
- if validity == True:
- word_score = get_word_score(word,HAND_SIZE)
- print "word score",word_score
- score = score + word_score
- print "score",score
- score += play_hand((update_hand(hand,word)),word_list)
- return score
Advertisement
Add Comment
Please, Sign In to add comment