From f844829c9cdec9170d106ad89ca5e8dfb5120b1e Mon Sep 17 00:00:00 2001 From: Kirill Artamonov Date: Sat, 8 Aug 2020 21:42:26 +0200 Subject: [PATCH] resistant color: extend exercise explanation (partial copy from resistant-color-duo) --- exercises/resistor-color-duo/description.md | 12 +++++++++--- exercises/resistor-color/description.md | 13 ++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/exercises/resistor-color-duo/description.md b/exercises/resistor-color-duo/description.md index 6d10075c61..886c41b0df 100644 --- a/exercises/resistor-color-duo/description.md +++ b/exercises/resistor-color-duo/description.md @@ -1,11 +1,17 @@ -If you want to build something using a Raspberry Pi, you'll probably use _resistors_. For this exercise, you need to know two things about them: +If you want to build something using a Raspberry Pi, you'll probably use _resistors_. +For this exercise, you need to know two things about them: * Each resistor has a resistance value. * Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read. -To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. Each band has a position and a numeric value. For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15. -In this exercise you are going to create a helpful program so that you don't have to remember the values of the bands. The program will take color names as input and output a two digit number, even if the input is more than two colors! +To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. +Each band has a position and a numeric value. +The first 2 bands of a resistor have a simple encoding scheme: each color maps to a single number. +For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15. + +In this exercise you are going to create a helpful program so that you don't have to remember the values of the bands. +The program will take color names as input and output a two digit number, even if the input is more than two colors! The band colors are encoded as follows: diff --git a/exercises/resistor-color/description.md b/exercises/resistor-color/description.md index 67bd215f74..c4bc231f7f 100644 --- a/exercises/resistor-color/description.md +++ b/exercises/resistor-color/description.md @@ -1,4 +1,15 @@ -Resistors have color coded bands, where each color maps to a number. The first 2 bands of a resistor have a simple encoding scheme: each color maps to a single number. +If you want to build something using a Raspberry Pi, you'll probably use _resistors_. +For this exercise, you need to know two things about them: + +* Each resistor has a resistance value. +* Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read. + +To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. +Each band has a position and a numeric value. + +The first 2 bands of a resistor have a simple encoding scheme: each color maps to a single number. + +In this exercise you are going to create a helpful program so that you don't have to remember the values of the bands. These colors are encoded as follows: