Skip to content

Commit d465cfe

Browse files
committed
fixed mistakes founded by autotest
1 parent 63a773f commit d465cfe

File tree

9 files changed

+26
-20
lines changed

9 files changed

+26
-20
lines changed

bin/brain-calc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import startCalcGame from '../src/games/calc.js';
3+
import startCalcGame from '../src/games/calc.js'
44

5-
startCalcGame();
5+
startCalcGame()

bin/brain-even.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import runBrainEven from '../src/games/even.js';
3+
import runBrainEven from '../src/games/even.js'
44

5-
runBrainEven();
5+
runBrainEven()

bin/brain-games.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import runBrainGames from '../src/cli.js';
3+
import runBrainGames from '../src/cli.js'
44

5-
runBrainGames();
5+
runBrainGames()

bin/brain-gcd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
import playGcd from '../src/games/gcd.js';
3+
import playGcd from '../src/games/gcd.js'
44

5-
playGcd();
5+
playGcd()

src/cli.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import readlineSync from 'readline-sync';
1+
import readlineSync from 'readline-sync'
22

33
export default function runBrainGames() {
4-
console.log('Welcome to the Brain Games!');
5-
const name = readlineSync.question('May I have your name? ');
6-
console.log(`Hello, ${name}!`);
4+
console.log('Welcome to the Brain Games!')
5+
const name = readlineSync.question('May I have your name? ')
6+
console.log(`Hello, ${name}!`)
77
}

src/games/calc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ const getCalculation = () => {
2525
return [`${a} ${op} ${b}`, String(correctAnswer)]
2626
}
2727

28-
export default () => runEngine(rule, getCalculation)
28+
const startCalcGame = () => runEngine(rule, getCalculation)
29+
30+
export default startCalcGame

src/games/even.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ const getQuestionAndAnswer = () => {
1313
return [question, correctAnswer]
1414
}
1515

16-
export default () => runEngine(rule, getQuestionAndAnswer)
16+
const startEvenGame = () => runEngine(rule, getQuestionAndAnswer)
17+
18+
export default startEvenGame

src/games/prime.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ const makeRound = () => {
1818
return [String(number), correctAnswer]
1919
}
2020

21-
export default () => runEngine(rule, makeRound)
21+
const startPrimeGame = () => runEngine(rule, makeRound)
22+
23+
export default startPrimeGame

src/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const getRandomNumber = (min, max) => {
2-
const minNum = Math.ceil(min);
3-
const maxNum = Math.floor(max);
2+
const minNum = Math.ceil(min)
3+
const maxNum = Math.floor(max)
44
// NOSONAR
5-
return Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
6-
};
5+
return Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum
6+
}
77

8-
export default getRandomNumber;
8+
export default getRandomNumber

0 commit comments

Comments
 (0)