'''
Created on March 27,2011

@author: ola
'''
 
import jottoModel

wlen = jottoModel.load_words()
print "Playing a game with ",wlen," letter words"
numLeft = jottoModel.start_game()
print "Number of words is ",numLeft

while True:
    word = jottoModel.get_guess()
    print "My guess is '"+word+"', how many letters in common with your word: ",
    common = int(raw_input())
    if common == 6:
        print "I win!! it took me ",
        print jottoModel.guess_count()," guesses!"
        break

    numLeft = jottoModel.process_common_last(common)
    print "Number of words left is",numLeft
    if numLeft == 0:
        print "an error was made, I have no words to guess"
        break
