Skip to content

Commit 6ce9036

Browse files
committed
Add more details to the hello example
1 parent d7332e0 commit 6ce9036

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exercises/simple-cipher/description.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ For example, the plaintext `"iamapandabear"` would become `"ldpdsdqgdehdu"`.
2929
If the key only contains the letter `"a"` (one or more times), the shift distance is zero and the ciphertext is the same as the plaintext.
3030

3131
Usually the key is more complicated than that, though!
32-
If the key is `"abcd"` then letters of the plaintext would be shifted by a distance of 0, 1, 2 then 3.
33-
Using that key, `"hello"` would become `"hfnoo"`.
32+
If the key is `"abcd"` then letters of the plaintext would be shifted by a distance of 0, 1, 2, and 3.
33+
If the plaintext is `"hello"`, we need 5 shifts so the key would wrap around, giving shift distances of 0, 1, 2, 3, and 0.
34+
Applying those shifts to the letters of `"hello"` we get `"hfnoo"`.
3435

3536
## Random keys
3637

0 commit comments

Comments
 (0)