Created
March 27, 2020 14:17
-
-
Save natintosh/f23b62edf3be4c6ac0f646886bfedf17 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
void main() { | |
print(resistorColor('Red')); | |
} | |
const List<String> colors = [ | |
'Black', | |
'Brown', | |
'Red', | |
'Orange', | |
'Yellow', | |
'Green', | |
'Blue', | |
'Violet', | |
'Grey', | |
'White', | |
]; | |
int resistorColor(String resistor) { | |
return colors.indexOf(resistor); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment