X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=cipher.py;fp=cipher.py;h=b53ae24184d09ba2b6bcf304c0de8a2f0077f318;hb=2e77bc75c34ac7d99310c1b778df972769068d98;hp=713db294846eece6c2ae72c9d1cfc5502836132f;hpb=34ba3d687eb48af30929b4550f14d1a599179efd;p=cipher-training.git diff --git a/cipher.py b/cipher.py index 713db29..b53ae24 100644 --- a/cipher.py +++ b/cipher.py @@ -212,7 +212,7 @@ def affine_decipher_letter(letter, multiplier=1, adder=0, one_based=True): if one_based: cipher_number += 1 plaintext_number = ( modular_division_table[multiplier] - [(cipher_number - adder) % 26] ) + [(cipher_number - adder) % 26]) if one_based: plaintext_number -= 1 return chr(plaintext_number % 26 + alphabet_start) else: @@ -566,7 +566,7 @@ class PocketEnigma(object): >>> pe.validate_wheel_spec([]) Traceback (most recent call last): ... - ValueError: Wheel specification has 0 pairs, require 13 + ValueError: Wheel specification has 0 pairs, requires 13 >>> pe.validate_wheel_spec([('a', 'b', 'c')]*13) Traceback (most recent call last): ...