Skip to content

Commit 07c8115

Browse files
authored
[Resistor Color Expert]: Fixed up Instructions & Introduction (#3873)
* Fixed up instructions and introduction with exercise links and normalized color names, * Further clarifications for list input. * final typo fixes.
1 parent 58d82a0 commit 07c8115

File tree

2 files changed

+40
-33
lines changed

2 files changed

+40
-33
lines changed
Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,82 @@
11
# Instructions
22

33
In this exercise, you are going to create a helpful program so that you don't have to remember the values of the bands.
4-
The program will take 1, 4, or 5 colors as input, and outputs the correct value, in ohms.
4+
The program will take 1, 4, or 5 colors as input and output the correct value in ohms.
55
The color bands are encoded as follows:
66

7-
- Black: 0
8-
- Brown: 1
9-
- Red: 2
10-
- Orange: 3
11-
- Yellow: 4
12-
- Green: 5
13-
- Blue: 6
14-
- Violet: 7
15-
- Grey: 8
16-
- White: 9
17-
18-
In `resistor-color trio` you decoded the first three colors.
7+
- black: 0
8+
- brown: 1
9+
- red: 2
10+
- orange: 3
11+
- yellow: 4
12+
- green: 5
13+
- blue: 6
14+
- violet: 7
15+
- grey: 8
16+
- white: 9
17+
18+
In [`Resistor Color Trio`][resistor-color-trio-exercise] you decoded the first three color bands.
1919
For instance: orange-orange-brown translated to the main value `330`.
2020
In this exercise you will need to add _tolerance_ to the mix.
2121
Tolerance is the maximum amount that a value can be above or below the main value.
22-
For example, if the last band is green, the maximum tolerance will be ±0.5%.
22+
For example, if the last band is green, the maximum tolerance will be `±0.5%`.
2323

2424
The tolerance band will have one of these values:
2525

26-
- Grey - 0.05%
27-
- Violet - 0.1%
28-
- Blue - 0.25%
29-
- Green - 0.5%
30-
- Brown - 1%
31-
- Red - 2%
32-
- Gold - 5%
33-
- Silver - 10%
26+
- grey - 0.05%
27+
- violet - 0.1%
28+
- blue - 0.25%
29+
- green - 0.5%
30+
- brown - 1%
31+
- red - 2%
32+
- gold - 5%
33+
- silver - 10%
3434

3535
The four-band resistor is built up like this:
3636

3737
| Band_1 | Band_2 | Band_3 | band_4 |
3838
| ------- | ------- | ---------- | --------- |
3939
| Value_1 | Value_2 | Multiplier | Tolerance |
4040

41-
Meaning
41+
Examples:
4242

43-
- orange-orange-brown-green would be 330 ohms with a ±0.5% tolerance.
44-
- orange-orange-red-grey would be 3300 ohms with ±0.05% tolerance.
43+
- orange-orange-brown-green would be `330` ohms with a `±0.5%` tolerance.
44+
- orange-orange-red-grey would be `3300` ohms with `±0.05%` tolerance.
4545

4646
The difference between a four and five-band resistor is that the five-band resistor has an extra band to indicate a more precise value.
4747

4848
| Band_1 | Band_2 | Band_3 | Band_4 | band_5 |
4949
| ------- | ------- | ------- | ---------- | --------- |
5050
| Value_1 | Value_2 | Value_3 | Multiplier | Tolerance |
5151

52-
Meaning
52+
Examples:
5353

54-
- orange-orange-orange-black-green would be 333 ohms with a ±0.5% tolerance.
55-
- orange-red-orange-blue-violet would be 323M ohms with a ±0.10 tolerance.
54+
- orange-orange-orange-black-green would be `333` ohms with a `±0.5%` tolerance.
55+
- orange-red-orange-blue-violet would be `323M` ohms with a `±0.10` tolerance.
5656

5757
There are also one band resistors.
5858
One band resistors only have the color black with a value of 0.
5959

60-
This exercise is about translating the resistor band colors into a label:
60+
61+
Your program should translate an input `list` of resistor band colors into a label:
6162

6263
"... ohms ...%"
6364

64-
So an input of "orange", "orange", "black", "green" should return:
65+
So an input `list` of `["orange", "orange", "black", "green"]` should return:
6566

6667
"33 ohms ±0.5%"
6768

6869
When there are more than a thousand ohms, we say "kiloohms".
6970
That's similar to saying "kilometer" for 1000 meters, and "kilograms" for 1000 grams.
7071

71-
So an input of "orange", "orange", "orange", "grey" should return:
72+
So an input `list` of `["orange", "orange", "orange", "grey"]` should return:
7273

7374
"33 kiloohms ±0.05%"
7475

7576
When there are more than a million ohms, we say "megaohms".
7677

77-
So an input of "orange", "orange", "blue", "red" should return:
78+
So an input `list` of `["orange", "orange", "blue", "red"]` should return:
7879

7980
"33 megaohms ±2%"
81+
82+
[resistor-color-trio-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-trio
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Introduction
22

33
If you want to build something using a Raspberry Pi, you'll probably use _resistors_.
4-
Like the previous `Resistor Color Duo` and `Resistor Color Trio` exercises, you will be translating resistor color bands to human-readable labels.
4+
Like the previous [`Resistor Color Duo`][resistor-color-duo-exercise] and [`Resistor Color Trio`][resistor-color-trio-exercise] exercises, you will be translating resistor color bands to human-readable labels.
55

66
- Each resistor has a resistance value.
77
- Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read.
88
To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values.
99
- Each band acts as a digit of a number.
1010
For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15.
11+
12+
13+
[resistor-color-duo-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-duo
14+
[resistor-color-trio-exercise]: https://exercism.org/tracks/python/exercises/resistor-color-trio

0 commit comments

Comments
 (0)