The current approach to testing the Affine Cipher is to use such-that to ensure that the greatest common divisor of a and 26 is 1. This may fail to be satisfied within the 10 attempts.
Suggestions
[x] Pre-compute (filter #(= 1 (gcd % 26)) (range 26)) and choose random elements within this list.
Issue
The current approach to testing the Affine Cipher is to use
such-that
to ensure that the greatest common divisor ofa
and 26 is 1. This may fail to be satisfied within the 10 attempts.Suggestions
(filter #(= 1 (gcd % 26)) (range 26))
andchoose
random elements within this list.