Advertisement
Guest User

Untitled

a guest
Feb 20th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. def play_hand(hand, word_list):
  2. hand
  3. Totalscore=0
  4.  
  5. while calculate_handlen(hand)>0:
  6. print "current hand ", display_hand(hand)
  7. choice=raw_input('Enter word, or a "." to indicate that you are finished: ')
  8. while choice not in word_list and is_valid_word(choice,hand,word_list)==False:
  9. choice=raw_input("Enter another word,")
  10. if choice=='.':
  11. break
  12.  
  13. if choice=='.':
  14. break
  15.  
  16.  
  17.  
  18. if is_valid_word(choice, hand, word_list)==True:
  19.  
  20. Totalscore+=get_word_score(choice,calculate_handlen(hand))
  21. print 'The word', choice, 'earned ',get_word_score(choice,calculate_handlen(hand))
  22. print 'Total Score: ', Totalscore
  23. hand=update_hand(hand,choice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement