Created
March 27, 2020 08:41
-
-
Save natintosh/ca7fba39e892311a81d9682ce65eba55 to your computer and use it in GitHub Desktop.
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
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); | |
}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