Skip to content

Instantly share code, notes, and snippets.

Created April 23, 2014 13:58
Show Gist options
  • Save anonymous/c7d18663fa5d3d614c66 to your computer and use it in GitHub Desktop.
Save anonymous/c7d18663fa5d3d614c66 to your computer and use it in GitHub Desktop.
cryption_hash = {"A" => 0, "B" => 1, "C" => 2, "D" => 3, "E" => 4, "F" => 5, "G" => 6, "H" => 7, "I" => 8, "J" => 9, "K" => 10, "L" => 11, "M" => 12, "N" => 13, "O" => 14, "P" => 15, "Q" => 16, "R" => 17, "S" => 18, "T" => 19, "U" => 20, "V" => 21, "W" => 22, "X" => 23, "Y" => 24, "Z" => 25}
content.upcase!
content.split("").each_with_index do |character, index|
if character == " "
next
end
character_hash_index = cryption_hash[character]
puts "yes"
puts character_hash_index
puts cryption.hash.invert[character_hash_index]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment