Skip to content

Commit f628900

Browse files
committed
fix eslint problems
1 parent 8be134c commit f628900

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

bin/brain-calc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import { playGameCalc } from '../games/brain-calc.js';
3-
4-
// Запускаем игру
5-
playGameCalc();
2+
import { playGameCalc } from '../games/brain-calc.js';
3+
4+
// Запускаем игру
5+
playGameCalc();

index.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ export const greeting = () => {
99
};
1010

1111
// Функция для генерации случайного числа от 1 до 100
12-
export const getRandomNumber = () => {
13-
return Math.floor(Math.random() * 100) + 1;
14-
};
12+
export const getRandomNumber = () => Math.floor(Math.random() * 100) + 1;
1513

1614
// Функция для проверки четности
17-
export const checkEvenness = (number) => {
18-
// Возвращаем 'yes', если четное, иначе 'no'
19-
return number % 2 === 0 ? 'yes' : 'no';
20-
};
15+
export const checkEvenness = (number) =>
16+
// Возвращаем 'yes', если четное, иначе 'no'
17+
(number % 2 === 0 ? 'yes' : 'no')
18+
;
2119

2220
// Функция подсчета ответов
2321
export const handleAnswer = (userAnswer, correctAnswer, userName, correctAnswersCount, incorrectMessage) => {
@@ -40,7 +38,6 @@ export const handleAnswer = (userAnswer, correctAnswer, userName, correctAnswers
4038
return { correctAnswersCount, finished: false };
4139
};
4240

43-
4441
// Функция для генерации случайного математического оператора
4542
export const getRandomOperator = () => {
4643
const operators = ['+', '-', '*'];
@@ -51,14 +48,12 @@ export const getRandomOperator = () => {
5148

5249
// Функция вычисления результата
5350
export const getResult = (num1, operator, num2) => {
54-
switch (operator) {
55-
case '+':
56-
return num1 + num2;
57-
case '-':
58-
return num1 - num2;
59-
case '*':
60-
return num1 * num2;
61-
}
51+
switch (operator) {
52+
case '+':
53+
return num1 + num2;
54+
case '-':
55+
return num1 - num2;
56+
case '*':
57+
return num1 * num2;
58+
}
6259
};
63-
64-

0 commit comments

Comments
 (0)