Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 20th, 2013  |  syntax: None  |  size: 0.78 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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)