Created
May 30, 2017 01:56
-
-
Save matt297/65570eac10cb6fbb01b38f2ca8b78948 to your computer and use it in GitHub Desktop.
Lighthouse Labs - Intro to Web Dev - W4D1 - May 2017 Cohort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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