class CryptogramSolver
- CryptogramSolver
- Reference
- Object
Defined in:
cryptogram.crcryptogram_byte.cr
Constructors
Instance Method Summary
- #build_indices
- #find_candidate_word_matches(encrypted_word, letter_mapping : Hash(Char, Char)) : Set(String)
- #find_candidate_word_matches(encrypted_word, letter_mapping : Hash(UInt8, UInt8)) : Set(String)
- #find_words_by_letter_and_position(letter, letter_index_position)
- #find_words_by_pattern(word_pattern)
- #guess(letter_mapping, reverse_letter_mapping, encrypted_words) : Array(Hash(UInt8, UInt8))
- #solve(phrase)
-
#try_extend_mapping(word, encrypted_word, letter_mapping, reverse_letter_mapping) : Tuple(Hash(UInt8, UInt8), Hash(UInt8, UInt8)) | Nil
if word is a possible match for the encrypted_word, given the existing letter_mapping, then this function returns the combined letter mappings of the word-specific letter mappings and the existing letter mappings; nil otherwise Assumes word.size == encrypted_word.size
- #word_pattern(word)
Constructor Detail
Instance Method Detail
def find_candidate_word_matches(encrypted_word, letter_mapping : Hash(Char, Char)) : Set(String)
#
def find_candidate_word_matches(encrypted_word, letter_mapping : Hash(UInt8, UInt8)) : Set(String)
#
def guess(letter_mapping, reverse_letter_mapping, encrypted_words) : Array(Hash(UInt8, UInt8))
#
def try_extend_mapping(word, encrypted_word, letter_mapping, reverse_letter_mapping) : Tuple(Hash(UInt8, UInt8), Hash(UInt8, UInt8)) | Nil
#
if word is a possible match for the encrypted_word, given the existing letter_mapping, then this function returns the combined letter mappings of the word-specific letter mappings and the existing letter mappings; nil otherwise Assumes word.size == encrypted_word.size