Created
October 29, 2021 11:03
-
-
Save Niall47/114b364d4b3229432716cc558a884cc5 to your computer and use it in GitHub Desktop.
This file contains 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
resistor_colours = ['black', 'brown', 'red', 'orange', 'yellow', 'green', 'blue', 'violet', 'grey', 'white'] | |
input_array = gets.chomp.gsub(' ', '').split('-') | |
puts resistor_colours.find_index(input_array[0]).to_s + resistor_colours.find_index(input_array[1]).to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment