- if not plain_alphabet:
- plain_alphabet = string.ascii_lowercase
- if not cipher_alphabet:
- cipher_alphabet = list(string.ascii_lowercase)
- random.shuffle(cipher_alphabet)
- cipher_alphabet = cat(cipher_alphabet)
- worker_args.append((ciphertext, plain_alphabet, cipher_alphabet,
- initial_temperature, max_iterations, fitness))
+ if plain_alphabet is None:
+ used_plain_alphabet = string.ascii_lowercase
+ else:
+ used_plain_alphabet = plain_alphabet
+ if cipher_alphabet is None:
+ used_cipher_alphabet = list(string.ascii_lowercase)
+ random.shuffle(used_cipher_alphabet)
+ used_cipher_alphabet = cat(used_cipher_alphabet)
+ else:
+ used_cipher_alphabet = cipher_alphabet
+ # if not plain_alphabet:
+ # plain_alphabet = string.ascii_lowercase
+ # if not cipher_alphabet:
+ # cipher_alphabet = list(string.ascii_lowercase)
+ # random.shuffle(cipher_alphabet)
+ # cipher_alphabet = cat(cipher_alphabet)
+ worker_args.append((ciphertext, used_plain_alphabet, used_cipher_alphabet,
+ swap_index_finder,
+ initial_temperature, max_iterations, fitness,
+ i))