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)
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)
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)
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)