Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def play_hand(hand, word_list,score = 0):
- display_hand(hand)
- count = element_counter(hand)
- if count == 0:
- print "Final Score", score
- return None
- word = raw_input("Enter a word or . to finish ")
- if word == "." :
- print "Final Score", score
- return None
- validity = is_valid_word(word,hand,word_list)
- if validity == True:
- word_score = get_word_score(word, count)
- print "word score",word_score
- score = score +word_score
- print "score so far", score
- play_hand(hand,word_list,score)#"""I didn't update the hand coz the function "is_valid_word" already
- ## does it by reducing the value of the letter used by 1"""
- if validity == False:
- print "choose another word"
- play_hand(hand,word_list,score)
- return None
Advertisement
Add Comment
Please, Sign In to add comment