X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=slides%2Fpocket-enigma-encipher.html;h=b569911bacd2289c108e6a327ea1bdd9aad42bf0;hb=e2044fd0989dded2a82dd76b2e1b440989aee9ef;hp=05222c570723e615c115fede04be25c715c51fdf;hpb=59f946c1f17379c59cb45457bee5c37ef4e70d92;p=cipher-training.git diff --git a/slides/pocket-enigma-encipher.html b/slides/pocket-enigma-encipher.html index 05222c5..b569911 100644 --- a/slides/pocket-enigma-encipher.html +++ b/slides/pocket-enigma-encipher.html @@ -105,24 +105,6 @@ What data should it hold? --- -# A note on testing - -Testing's easier if everything returns a meaningful value - -Saves having to look up different values after performing each operation - -`__init__` can't return a value (restriction of Python) - -```python -if __name__ == "__main__": - import doctest - doctest.testmod(extraglobs={'pe': PocketEnigma(1, 'a')}) -``` - -`pe` is now available in all tests. - ---- - # Data structures What's a convenient representation of the wheel @@ -203,6 +185,24 @@ class PocketEnigma(object): --- +# A note on testing + +Testing's easier if everything returns a meaningful value + +Saves having to look up different values after performing each operation + +`__init__` can't return a value (restriction of Python) + +```python +if __name__ == "__main__": + import doctest + doctest.testmod(extraglobs={'pe': PocketEnigma(1, 'a')}) +``` + +`pe` is now available in all tests. + +--- + # Looking up the enciphered version of a letter *Not* advancing the wheel before