File tree Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import playGame from '../index.js';
22
33import randomNumber from '../utils.js' ;
44
5- const questionGame =
6- 'Answer "yes" if the number is even, otherwise answer "no".' ;
5+ const questionGame = 'Answer "yes" if the number is even, otherwise answer "no".' ;
76
87const questionRound = ( ) => {
98 const number = randomNumber ( 1 , 100 ) ;
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import playGame from '../index.js';
22
33import randomNumber from '../utils.js' ;
44
5- const questionGame =
6- 'Answer "yes" if given number is prime. Otherwise answer "no".' ;
5+ const questionGame = 'Answer "yes" if given number is prime. Otherwise answer "no".' ;
76
87const questionRound = ( ) => {
98 const number = randomNumber ( 1 , 10 ) ;
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ const questionRound = () => {
2020 const result = progression ( ) [ itemSkip ] . toString ( ) ;
2121
2222 const arrProgression = progression ( ) ;
23-
23+ /* eslint-disable no-unused-vars */
2424 const skipItem = arrProgression . splice ( [ itemSkip ] , 1 , '..' ) ;
25-
25+ /* eslint-enable no-unused-vars */
2626 const question = `Question: ${ arrProgression . join ( ' ' ) } ` ;
2727
2828 return [ question , result ] ;
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ const playGame = (questiongame, questionRound) => {
1818 const correctAnsw = round [ 1 ] ;
1919 // вывод неправильного ответа
2020 const wrong = ( ) => {
21- console . log (
22- `'${ answer } ' is wrong answer ;(. Correct answer was '${ correctAnsw } '.\nLet's try again, ${ userName } !`
23- ) ;
21+ console . log ( `'${ answer } ' is wrong answer ;(. Correct answer was '${ correctAnsw } '.\nLet's try again, ${ userName } !` ) ;
2422 } ;
2523 // проверка
2624 if ( answer === correctAnsw ) {
@@ -35,7 +33,7 @@ const playGame = (questiongame, questionRound) => {
3533 const winMessage = ( ) => {
3634 console . log ( `Congratulations, ${ userName } !` ) ;
3735 } ;
38- winMessage ( ) ;
36+ return winMessage ( ) ;
3937} ;
4038
4139export default playGame ;
You can’t perform that action at this time.
0 commit comments