예제 #1
0
def load_letter_seq():
    global letters, word_dict
    word_dict = engine.create_dict_from_word_list(engine.load_words())
    letters = []
    letters = engine.choose_seq_letters(engine.LETTER_FREQS, 6)
    while len(engine.find_valid_words(letters, word_dict)) < 60:  # letter list must contain at least 60 possible words
        letters = engine.choose_seq_letters(engine.LETTER_FREQS, 6)
예제 #2
0
def load_letter_seq():
    global letters, word_dict
    word_dict = engine.create_dict_from_word_list(engine.load_words())
    letters = []
    letters = engine.choose_seq_letters(engine.LETTER_FREQS, 6)
    while (len(engine.find_valid_words(letters, word_dict)) < 60): # letter list must contain at least 60 possible words
        letters = engine.choose_seq_letters(engine.LETTER_FREQS, 6)
예제 #3
0
import engine
from constants import LETTER_FREQS

if __name__ == '__main__':
    word_dict = engine.create_dict_from_word_list(engine.load_words())
    letter_seq = engine.choose_seq_letters(LETTER_FREQS, 6)
    print 'Six Letter Sample Game w/out Time'
    print 'Quit by typing \'quitnow\''
    print 'Your letters are:', letter_seq
    input_str = ''
    word_matches = set()
    while (input != 'quitnow'):
        input_str = str(
            raw_input('Your Word Guess: '))  # enforce letter_seq restrictions
        if engine.is_word(input_str, word_dict):
            if input_str in word_matches:
                print input_str, 'is already in the correct list'
            else:
                print input_str, 'is a word'
                word_matches.add(input_str)
        else:
            print input_str, 'is NOT a word!'

    print 'Words:', list(word_matches)
    print 'Score:', len(word_matches)
예제 #4
0
import engine
from constants import LETTER_FREQS

if __name__ == '__main__':
    word_dict = engine.create_dict_from_word_list(engine.load_words())
    letter_seq = engine.choose_seq_letters(LETTER_FREQS, 6)
    print 'Six Letter Sample Game w/out Time'
    print 'Quit by typing \'quitnow\''
    print 'Your letters are:', letter_seq
    input_str = ''
    word_matches = set()
    while (input != 'quitnow'):
        input_str = str(raw_input('Your Word Guess: ')) # enforce letter_seq restrictions
        if engine.is_word(input_str, word_dict):
            if input_str in word_matches:
                print input_str, 'is already in the correct list'
            else:
                print input_str, 'is a word'
                word_matches.add(input_str)
        else:
            print input_str, 'is NOT a word!'
    
    print 'Words:', list(word_matches)
    print 'Score:', len(word_matches)