May-02-2018, 04:38 AM
I am playing with breaking ancient ciphers.
In this particular puzzle, it is not allowed for a letter to encrypt to itself.
I am using word patterns to get a list of candidates for each cipher word.
I want to throw out words that would violate this rule.
I tried using a while loop to iterate through each letter and see if they match or not. It is taking forever.
Is there a faster way? What is the fastest way to check for this?
Example:
XKKTU could be APPLE but AKKTU could not be APPLE, because it means the A would have encrypted to itself.
I want to go through the possible words that AKKTU could be and throw out apple form the list.
I just need to know the fastest way to compare the letters in the possible word with the encrypted word.
Thanks
In this particular puzzle, it is not allowed for a letter to encrypt to itself.
I am using word patterns to get a list of candidates for each cipher word.
I want to throw out words that would violate this rule.
I tried using a while loop to iterate through each letter and see if they match or not. It is taking forever.
Is there a faster way? What is the fastest way to check for this?
Example:
XKKTU could be APPLE but AKKTU could not be APPLE, because it means the A would have encrypted to itself.
I want to go through the possible words that AKKTU could be and throw out apple form the list.
I just need to know the fastest way to compare the letters in the possible word with the encrypted word.
Thanks