Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Faster way?
#1
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
Reply


Messages In This Thread
Faster way? - by jarrod0987 - May-02-2018, 04:38 AM
RE: Faster way? - by ThiefOfTime - May-02-2018, 07:51 AM
RE: Faster way? - by jarrod0987 - May-02-2018, 08:29 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020