#!/usr/bin/env ruby # C O D E X D E C R Y P T puts "Enter that you have been trusted with." codex = gets puts "For your eyes only:" + "\n" def decrypt(codex) transformer = { "2" => "a", "i" => "b", "b" => "c", "z" => "d", "0" => "e", "h" => "f", "a" => "g", "7" => "h", "x" => "i", "3" => "j", "q" => "k", "c" => "l", "g" => "m", "1" => "n", "6" => "o", "m" => "p", "r" => "q", "p" => "r", "5" => "s", "l" => "t", "9" => "u", "e" => "v", "v" => "w", "y" => "x", "w" => "y", "d" => "z", "8" => ".", "n" => ",", "f" => "?", "u" => "\(", "k" => "\)", "t" => "\"", "o" => ":", "s" => "$", "j" => "\'", "4" => " ", } decryption = codex.downcase.split(" ").join("") puts decryption.gsub(/\S/, transformer).upcase end decrypt(codex)