Move to Project.toml, bump to Julia v1 (#18)

This commit is contained in:
Patrick Stevens
2019-09-12 19:18:28 +01:00
committed by GitHub
parent 3196694bc1
commit 2a0eb5c630
24 changed files with 128 additions and 105 deletions

View File

@@ -5,7 +5,7 @@ so encrypt_caesar("abc", 1) == "BCD".
Converts the input to uppercase.
"""
function encrypt_caesar(plaintext, key::Integer)
function encrypt_caesar(plaintext, key::T) where {T<:Integer}
# plaintext: string; key: integer offset, so k=1 sends "a" to "b"
key = ((key-1) % 26) + 1
keystr = join([collect(Char(97+key):'z'); collect('a':Char(97+key-1))])