File tree Expand file tree Collapse file tree 9 files changed +26
-20
lines changed Expand file tree Collapse file tree 9 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 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 ( )
Original file line number Diff line number Diff line change 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 ( )
Original file line number Diff line number Diff line change 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 ( )
Original file line number Diff line number Diff line change 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 ( )
Original file line number Diff line number Diff line change 1- import readlineSync from 'readline-sync' ;
1+ import readlineSync from 'readline-sync'
22
33export 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}
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11const 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
You can’t perform that action at this time.
0 commit comments