Skip to content

Instantly share code, notes, and snippets.

@natintosh
Created March 27, 2020 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natintosh/f23b62edf3be4c6ac0f646886bfedf17 to your computer and use it in GitHub Desktop.
Save natintosh/f23b62edf3be4c6ac0f646886bfedf17 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment