Tweaked slide layout
[cipher-training.git] / slides / caesar-encipher.html
index a4d5b2df15bbec0f783b85e6a2d2658314a32742..4ef1d341125d73a444a6d2cbbc01a7e7dce08c7c 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>Title</title>
+    <title>Caesar cipher</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <style type="text/css">
       /* Slideshow styles */
@@ -12,7 +12,7 @@
         font-weight: 400;
         margin-bottom: 0;
       }
-      h1 { font-size: 4em; }
+      h1 { font-size: 3em; }
       h2 { font-size: 2em; }
       h3 { font-size: 1.6em; }
       a, a > code {
         text-shadow: 0 0 20px #333;
         padding: 2px 5px;
       }
+      .indexlink {
+        position: absolute;
+        bottom: 1em;
+        left: 1em;
+      }
     </style>
   </head>
   <body>
@@ -50,6 +55,12 @@ Letter-by-letter enciphering
 
 ---
 
+layout: true
+
+.indexlink[[Index](index.html)]
+
+---
+
 # Enciphering and deciphering
 
 ## Arithmetic on letters
@@ -64,7 +75,7 @@ ord()
 
 chr()
 
-mod()
+%
 ```
 
 * What are good test cases?
@@ -103,37 +114,13 @@ def caesar_encipher_letter(letter, shift):
     'b'
     """
     if letter in string.ascii_letters:
+    .
+    .
+    .
 ```
 
 ---
 
-# My tests
-
-```python
-def caesar_encipher_letter(letter, shift):
-    """Encipher a letter, given a shift amount
-
-    >>> caesar_encipher_letter('a', 1)
-    'b'
-    >>> caesar_encipher_letter('a', 2)
-    'c'
-    >>> caesar_encipher_letter('b', 2)
-    'd'
-    >>> caesar_encipher_letter('x', 2)
-    'z'
-    >>> caesar_encipher_letter('y', 2)
-    'a'
-    >>> caesar_encipher_letter('z', 2)
-    'b'
-    >>> caesar_encipher_letter('z', -1)
-    'y'
-    >>> caesar_encipher_letter('a', -1)
-    'z'
-    """
-    if letter in string.ascii_letters:
-```
----
-
 # The magic doctest incantation
 
 ```python
@@ -177,6 +164,8 @@ for p in plaintext:
     ciphertext += caesar_encipher_letter(p, key)
 ```
 
+...but easily generalisable
+
 ---
 
 # Doing all the letters
@@ -208,7 +197,7 @@ ciphertext = [caesar_encipher_letter(p, key) for p in plaintext]
     <script src="http://gnab.github.io/remark/downloads/remark-0.6.0.min.js" type="text/javascript">
     </script>
     <script type="text/javascript">
-      var slideshow = remark.create();
+      var slideshow = remark.create({ ratio: "16:9" });
     </script>
   </body>
 </html>
\ No newline at end of file