Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def play_hand_r(hand, word_list):
- if calculate_handlen(hand) == 0:
- print "All letters in hand used"
- return 0
- print "Current Hand:",
- display_hand(hand)
- word = raw_input('Enter word, or a "." to indicate that you are finished: ')
- if word == ".":
- print "User ended hand!"
- return 0
- elif is_valid_word(word,hand,word_list):
- new_hand = update_hand(hand,word)
- print '"' + word + '" earned', get_word_score(word,HAND_SIZE), "points"
- print
- score = get_word_score(word,HAND_SIZE) + play_hand_r(new_hand, word_list)
- return score
- else:
- print "invalid entry try again" + "\n"*3
- play_hand_r(hand, word_list)
- return 0
- def play_hand(hand, word_list):
- """
- total = play_hand_r(hand, word_list)
- print "the total score was", total
Advertisement
Add Comment
Please, Sign In to add comment