Skip to content

Instantly share code, notes, and snippets.

@natintosh
Created March 27, 2020 08:41
Show Gist options
  • Save natintosh/ca7fba39e892311a81d9682ce65eba55 to your computer and use it in GitHub Desktop.
Save natintosh/ca7fba39e892311a81d9682ce65eba55 to your computer and use it in GitHub Desktop.
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