Skip to content

Commit

Permalink
Merge pull request #1 from MastersAcademy/master
Browse files Browse the repository at this point in the history
новые дз 3 и4
  • Loading branch information
AntowkaGor authored Nov 17, 2018
2 parents 0612691 + 5e51b04 commit 9deb613
Show file tree
Hide file tree
Showing 225 changed files with 4,494 additions and 21 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ jobs:
parallelism: 4
steps:
- checkout
- run: npm install
- run: npm test
- run: npm install --production
- run: npm run test-js
- run: npm run test-css
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{css,scss,yml}]
[*.{css,scss,yml,json}]
indent_style = space
indent_size = 2
tab_width = 2
Expand Down
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
module.exports = {
extends: 'eslint:recommended',
extends: 'airbnb-base',
env: {
browser: true,
es6: true
es6: true,
node: true,
mocha: true,
jasmine: true,
jest: true
},
rules: {
// enable additional rules
Expand All @@ -16,8 +20,8 @@ module.exports = {
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-undef': 'off',
'no-unused-vars': ['error', { vars: 'local' }],
'no-plusplus': 'off',

// override default options for rules from base configurations
'no-cond-assign': ['error', 'always'],
Expand All @@ -29,7 +33,6 @@ module.exports = {
'guard-for-in': 'error',
'no-loop-func': 'error',
'no-self-compare': 'error',
// 'no-use-before-define': 'error',
'no-unneeded-ternary': 'error'
}
};
38 changes: 38 additions & 0 deletions homeworks/Aleksandr.Turuta_turuta7/homework_2/number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Get the number from the console
const readline = require('readline');

const r1 = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

// The function of calculating mirror numbers.
function func(num) {
for (let i = 1; i <= num; i++) {
const str = String(i);
if (str.length === 3) {
if (str[0] === str[2]) {
console.log(str);
}
}
if (str.length === 4) {
if (str[0] === str[3] && str[1] === str[2]) {
console.log(str);
}
}
if (str.length === 5) {
if (str[0] === str[4] && str[1] === str[3]) {
console.log(str);
}
}
if (num < 100 || num > 99999 || num === 0) {
console.log('Ошибка ввода');
return;
}
}
}

r1.question('Введите количество символов (от 100 до 99999): ', (num) => {
func(num);
r1.close();
});
28 changes: 28 additions & 0 deletions homeworks/Aleksandr.Turuta_turuta7/homework_2/piramida.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get the number from the console
const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

// Pyramid function
function func(num) {
let i = 2;
const bs = ' ';
const str = '#';
let j;
if (num > 50) {
console.log('Число больше 50');
return;
}
for (j = num; j >= 1; j--) {
i += 2;
console.log(bs.repeat(j) + str.repeat(i));
}
}

rl.question('Ввкдите количкство строк (до 50шт.): ', (num) => {
func(num);
rl.close();
});
11 changes: 11 additions & 0 deletions homeworks/Aleksey.Belik_ipodmeloman/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "package.json",
"version": "1.1.1",
"description": "node version v10.13.0 npm version 6.4.1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
5 changes: 5 additions & 0 deletions homeworks/Aleksey.Belik_ipodmeloman/homework_1/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alex@alex-System-Product-Name:~$ node --version
v10.13.0
alex@alex-System-Product-Name:~$ npm --version
6.4.1

10 changes: 10 additions & 0 deletions homeworks/Alexey.Berkut_AlBerkut/homework_2/palindrome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function checkPl(str) {
return (str === str.split('').reverse().join(''));
}

for (let i = 500; i < 1000; i++) {
const x = String(i);
if (checkPl(x) === true) {
console.log(x);
}
}
13 changes: 13 additions & 0 deletions homeworks/Alexey.Berkut_AlBerkut/homework_2/piramid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function build(num) {
let li = num;
const symbl = '#';
const space = '_';
let i = 2;

for (li > 0; li--;) {
i += 2;
console.log(space.repeat(li) + symbl.repeat(i));
}
}

build(15);
10 changes: 10 additions & 0 deletions homeworks/Alexey.Bezpoyasny_AlexBezp/homework_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@





alex@alex-Aspire:~/MOC/js-course-2018/homeworks/Alexey.Bezpoyasny_AlexBezp/homework_1$ node -v
v11.1.0
alex@alex-Aspire:~/MOC/js-course-2018/homeworks/Alexey.Bezpoyasny_AlexBezp/homework_1$ npm --version
6.4.1

11 changes: 11 additions & 0 deletions homeworks/Alexey.Bezpoyasny_AlexBezp/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "hm1",
"version": "1.0.0",
"description": "hm_1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Alexey Bezpoyasny",
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node v10.13.0
npm 6.4.1
11 changes: 11 additions & 0 deletions homeworks/Andrew.Tsarevsky_TsarevskyAndrew/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "homework_1",
"version": "1.0.0",
"description": "node v10.13.0\r npm 6.4.1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Tsarevsky Andrew",
"license": "ISC"
}
2 changes: 2 additions & 0 deletions homeworks/Bohdan.Krasnoschok_kAmIkAdzE9/homework_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node 11.1.0
npm 6.4.1
12 changes: 12 additions & 0 deletions homeworks/Bohdan.Krasnoschok_kAmIkAdzE9/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "homework_1",
"version": "1.0.0",
"description": "node 11.1.0\r npm 6.4.1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
6 changes: 6 additions & 0 deletions homeworks/Bohdan.Krasnoschok_kAmIkAdzE9/homework_2/Task_1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const N = 15;
const str = ' ';
const str2 = '##';
for (let i = 0; i < N; i++) {
console.log(str.repeat(N - i) + str2.repeat(i + 2));
}
14 changes: 14 additions & 0 deletions homeworks/Bohdan.Krasnoschok_kAmIkAdzE9/homework_2/Task_2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const a = 500;
const b = 1000;
for (let i = a; i < b; i++) {
i += '';
let flag = true;
for (let j = 0; j < i.length / 2; j++) {
if (i[j] !== i[i.length - 1 - j]) {
flag = false;
}
}
if (flag === true) {
console.log(i);
}
}
2 changes: 2 additions & 0 deletions homeworks/Den.Sokurenko_Den4ik08/homework_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v10.13.0
6.4.1
11 changes: 11 additions & 0 deletions homeworks/Den.Sokurenko_Den4ik08/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "homework_1",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": ""
}
27 changes: 27 additions & 0 deletions homeworks/Dmitriy.Tyulpa_innocentDimon/homework_2/mirror.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

const readline = require('readline');

const mirrorRange = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

function isMirror(str) {
return str === str.split('').reverse().join('');
}

mirrorRange.question('Введите диапазон чисел через пробел: ', (range) => {
const rangeArray = range.split(' ');
const min = Number(rangeArray[0]);
const max = Number(rangeArray[1]);
if (rangeArray.length > 2 || Number.isNaN(min) || Number.isNaN(max) || min >= max) {
console.log('Введите правильный диапазон');
} else {
for (let i = min; i < max + 1; i++) {
if (isMirror(i.toString())) {
console.log(i);
}
}
}
mirrorRange.close();
});
22 changes: 22 additions & 0 deletions homeworks/Dmitriy.Tyulpa_innocentDimon/homework_2/pyramid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

const readline = require('readline');

const pyramidHeight = readline.createInterface({
input: process.stdin,
output: process.stdout,
});

pyramidHeight.question('Введите высоту пирамиды? ', (height) => {
if (Number.isNaN(Number(height))) {
console.log('Необходимо ввести число!');
} else {
const str = '#';
const space = ' ';
let top = 4;
for (let i = 0; i < height; i++) {
console.log(space.repeat(height - (i + 1)) + str.repeat(top));
top += 2;
}
}
pyramidHeight.close();
});
5 changes: 5 additions & 0 deletions homeworks/Dmytro.Tyshchenko_DmytroTy/homework_2/numbers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
for (let i = 5; i <= 9; i++) {
for (let j = 0; j <= 9; j++) {
console.log(i.toString() + j + i);
}
}
3 changes: 3 additions & 0 deletions homeworks/Dmytro.Tyshchenko_DmytroTy/homework_2/piramida.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for (let i = 1; i <= 15; i++) {
console.log(' '.repeat(15 - i) + '#'.repeat((i + 1) * 2));
}
6 changes: 6 additions & 0 deletions homeworks/Ivan.Artemenko_IvanArtemenko/homework_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
V***:~$ node -v
v10.13.0
V***:~$ npm --version
6.4.1


11 changes: 11 additions & 0 deletions homeworks/Ivan.Artemenko_IvanArtemenko/homework_1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "homework_1",
"version": "1.0.0",
"description": "V:~$ node -v v10.13.0 V:~$ npm --version 6.4.1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
20 changes: 20 additions & 0 deletions homeworks/Ivan.Artemenko_IvanArtemenko/homework_2/homework_2_1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question('Enter the number of triangle levels from 3 to 15 ', (number) => {
const numeric = number - 0;
if (numeric <= 16 && numeric >= 3) {
for (let i = 2; i <= numeric + 1; i++) {
let a = '**';
let b = ' ';
const j = ((numeric + 1) - i);
a = a.repeat(i);
b = b.repeat(j);
console.log(b + a);
}
} else console.log('You must enter a number from 3 to 15');
rl.close();
});
32 changes: 32 additions & 0 deletions homeworks/Ivan.Artemenko_IvanArtemenko/homework_2/homework_2_2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question('Enter the first number from 500 to 1000 ', (numericOne) => {
rl.question('Enter the second number from 500 to 1000 ', (numericTwo) => {
const a = numericOne - 0;
const b = numericTwo - 1;
if (a >= b) {
if (b + 1 >= 500 && a - 1 < 1000) {
for (let i = b; i <= a; i++) {
const z = i.toString().split('').reverse().join('');
const k = i.toString();
if (z === k) {
console.log(i);
}
}
} else console.log('Invalid data enter a number from 500 to 1000');
} else if (a >= 500 && b < 1000) {
for (let i = a; i <= b; i++) {
const z = i.toString().split('').reverse().join('');
const k = i.toString();
if (z === k) {
console.log(i);
}
}
} else console.log('Invalid data enter a number from 500 to 1000');
rl.close();
});
});
Loading

0 comments on commit 9deb613

Please sign in to comment.