Skip to content

Instantly share code, notes, and snippets.

@matt297
Created May 30, 2017 01:56
Lighthouse Labs - Intro to Web Dev - W4D1 - May 2017 Cohort
user_input = "TESTPHONEN"
if user_input.length == 10
user_input.each_char do |letter|
case letter
when("A".."C") then print "2"
when("D".."F") then print "3"
when("G".."I") then print "4"
when("J".."L") then print "5"
when("M".."O") then print "6"
when("P".."S") then print "7"
when("T".."V") then print "8"
when("W".."Z") then print "9"
end
end
else
puts "You didn't enter 10 characters"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment