-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
10,575 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
bin/* | ||
dist/* | ||
docs/* | ||
node_modules/* | ||
production_node_modules/* | ||
test/fixtures/* | ||
tmp/* | ||
jest.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/array-type": "off", // Styling not forced upon the student | ||
"@typescript-eslint/explicit-function-return-type": [ | ||
"warn", { | ||
"allowExpressions": false, | ||
"allowTypedFunctionExpressions": true, | ||
"allowHigherOrderFunctions": true | ||
} | ||
], // Prevent bugs | ||
"@typescript-eslint/explicit-member-accessibility": "off", // Styling not forced upon the student | ||
"@typescript-eslint/indent": "off", // Styling not forced upon the student | ||
"@typescript-eslint/no-inferrable-types": [ | ||
"error", { | ||
"ignoreParameters": true | ||
} | ||
], | ||
"@typescript-eslint/member-delimiter-style": "off", // Styling not forced upon the student | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-parameter-properties": [ | ||
"warn", { | ||
"allows": [ | ||
"private", "protected", "public", | ||
"private readonly", "protected readonly", "public readonly" | ||
] | ||
} | ||
], // only disallow readonly without an access modifier | ||
"@typescript-eslint/no-unused-vars": "off", // Covered by the tsc compiler (noUnusedLocals) | ||
"@typescript-eslint/no-use-before-define": [ | ||
"error", { | ||
"functions": false, | ||
"typedefs": false | ||
} | ||
], // Prevent bugs, not styling | ||
"semi": "off", // Always disable base-rule | ||
"@typescript-eslint/semi": "off" // Styling not forced upon student | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Resistor Color Duo | ||
|
||
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! | ||
|
||
The colors are mapped to the numbers from 0 to 9 in the sequence: | ||
Black - Brown - Red - Orange - Yellow - Green - Blue - Violet - Grey - White | ||
|
||
From the example above: | ||
brown-green should return 15 | ||
brown-green-violet should return 15 too, ignoring the third color. | ||
|
||
## Setup | ||
|
||
Go through the setup instructions for Javascript to | ||
install the necessary dependencies: | ||
|
||
[https://exercism.io/tracks/javascript/installation](https://exercism.io/tracks/javascript/installation) | ||
|
||
## Requirements | ||
|
||
Install assignment dependencies: | ||
|
||
```bash | ||
$ npm install | ||
``` | ||
|
||
## Making the test suite pass | ||
|
||
Execute the tests with: | ||
|
||
```bash | ||
$ npm test | ||
``` | ||
|
||
In the test suites all tests but the first have been skipped. | ||
|
||
Once you get a test passing, you can enable the next one by | ||
changing `xtest` to `test`. | ||
|
||
## Source | ||
|
||
Maud de Vries, Erik Schierboom [https://github.com/exercism/problem-specifications/issues/1464](https://github.com/exercism/problem-specifications/issues/1464) | ||
|
||
## Submitting Incomplete Solutions | ||
|
||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
verbose: true, | ||
projects: [ | ||
'<rootDir>' | ||
], | ||
testMatch: [ | ||
"**/__tests__/**/*.[jt]s?(x)", | ||
"**/test/**/*.[jt]s?(x)", | ||
"**/?(*.)+(spec|test).[jt]s?(x)" | ||
], | ||
testPathIgnorePatterns: [ | ||
'/(?:production_)?node_modules/', | ||
'.d.ts$', | ||
'<rootDir>/test/fixtures', | ||
'<rootDir>/test/helpers', | ||
'__mocks__' | ||
], | ||
transform: { | ||
'^.+\\.[jt]sx?$': 'ts-jest', | ||
}, | ||
}; |
Oops, something went wrong.