From 321825828ac918bad28d0597a8616c6dc9802c3c Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 11 Aug 2021 15:26:15 +0530 Subject: Add solved exercises --- c/resistor-color/src/resistor_color.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 c/resistor-color/src/resistor_color.c (limited to 'c/resistor-color/src/resistor_color.c') diff --git a/c/resistor-color/src/resistor_color.c b/c/resistor-color/src/resistor_color.c new file mode 100644 index 0000000..ee85f6e --- /dev/null +++ b/c/resistor-color/src/resistor_color.c @@ -0,0 +1,13 @@ +#include "resistor_color.h" + +static resistor_band_t bands[] = { + BLACK, BROWN, RED, ORANGE, YELLOW, GREEN, BLUE, VIOLET, GREY, WHITE +}; + +int color_code(resistor_band_t color) { + return color; +} + +const resistor_band_t* colors(void) { + return bands; +} -- cgit 1.4.1-2-gfad0