S03

Contents

Synopsis

Exercise 2

rotate :: Int -> [a] -> [a]Source

Exercise 3

int2let :: Int -> CharSource

Transform an integer into a lowercase letter (where 0 is a and 25 is z).

let2int :: Char -> IntSource

Transform a lowercase letter into an integer.

shift :: Int -> Char -> CharSource

Shift a lowercase letter by a given number of positions in the alphabet.

encode :: Int -> String -> StringSource

Shift all lowercase letters in the input string by a given number of positions in the alphabet, thereby applying Caesar's cipher.

Exercise 4

freqs :: String -> [Float]Source

Exercise 5

chisqr :: [Float] -> [Float] -> FloatSource

Exercise 6

crack :: String -> StringSource