-
Notifications
You must be signed in to change notification settings - Fork 0
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
as.zaycev
committed
Feb 14, 2022
1 parent
a29c5d0
commit fa3ee40
Showing
10 changed files
with
15,273 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/src/Classes.d.ts |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx pretty-quick --staged |
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,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": true, | ||
"arrowParens": "always" | ||
} |
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,23 @@ | ||
# Basic Syntax | ||
|
||
Установите зависимости: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
В файле `src/BasicSyntax.js` в функции `romanToInteger` напишите код, преобразующий число из римской записи в арабскую. На вход вы получите строку, ответом должно быть число. | ||
|
||
| Символ | Значение | | ||
| ------ | -------- | | ||
| I | 1 | | ||
| V | 5 | | ||
| X | 10 | | ||
| L | 50 | | ||
| C | 100 | | ||
| D | 500 | | ||
| M | 1000 | | ||
|
||
Проверить себя можно запустив команду `npm run test`. | ||
|
||
После выполнения задания создайте pull request с решением. |
Large diffs are not rendered by default.
Oops, something went wrong.
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,43 @@ | ||
{ | ||
"name": "task-basic-syntax", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@types/jest": "^26.0.15", | ||
"@types/node": "^12.0.0", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-scripts": "4.0.3", | ||
"typescript": "^4.1.2" | ||
}, | ||
"scripts": { | ||
"test": "react-scripts test", | ||
"lint": "eslint ./src", | ||
"prepare": "husky install" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"husky": "^7.0.0", | ||
"prettier": "^2.4.1", | ||
"pretty-quick": "^3.1.1" | ||
} | ||
} |
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 @@ | ||
export function romanToInteger(str) { | ||
let result = 0; | ||
/* | ||
Напишите код, преобразующий число из римской записи в арабскую. | ||
На вход вы получите строку, ответом должно быть число. | ||
*/ | ||
return result; | ||
} |
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,11 @@ | ||
import { romanToInteger } from './BasicSyntax'; | ||
|
||
describe('Базовый синтаксис', () => { | ||
it('Преобразование римских чисел в арабские', () => { | ||
expect(romanToInteger('II')).toBe(2); | ||
expect(romanToInteger('XVI')).toBe(16); | ||
expect(romanToInteger('XXXVII')).toBe(37); | ||
expect(romanToInteger('MMMCDXLIV')).toBe(3444); | ||
expect(romanToInteger('MCMXCIX')).toBe(1999); | ||
}); | ||
}); |
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 @@ | ||
/// <reference types="react-scripts" /> |
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,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx" | ||
}, | ||
"include": ["src"] | ||
} |