def encrypt(codex) transformer = { "a" => "2", "b" => "i", "c" => "b", "d" => "z", "e" => "0", "f" => "h", "g" => "a", "h" => "7", "i" => "x", "j" => "3", "k" => "q", "l" => "c", "m" => "g", "n" => "1", "o" => "6", "p" => "m", "q" => "r", "r" => "p", "s" => "5", "t" => "l", "u" => "9", "v" => "e", "w" => "v", "x" => "y", "y" => "w", "z" => "d", "." => "8", "," => "n", "?" => "f", "\(" => "u", "\)" => "k", "\"" => "t", ":" => "o", "$" => "s", "\'" => "j", } encryption = codex.to_s.downcase.gsub(/\S/, transformer).gsub(/\s/, "4") puts encryption.upcase.chars.join(" ") end