File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 22[ ![ Actions Status] ( https://github.com/WisdomQuest/frontend-project-44/actions/workflows/hexlet-check.yml/badge.svg )] ( https://github.com/WisdomQuest/frontend-project-44/actions )
33https://asciinema.org/a/zNBty6rqBic6N4Zn5Dmt2Sscb
44https://asciinema.org/a/1gZpYskJ5KBIjVJ1hPz54XRTA
5- https://asciinema.org/a/71IF0vgTroz1mKOkWNXso17kC
5+ https://asciinema.org/a/71IF0vgTroz1mKOkWNXso17kC
6+ https://asciinema.org/a/25qN41IugvU3deXO70Rq9PAGq
Original file line number Diff line number Diff line change @@ -4,16 +4,18 @@ import randomNumber from '../utilRandomNumber.js';
44const descriptionGame = 'What number is missing in the progression?' ;
55
66const actionGame = ( ) => {
7- const progression = [ ] ;
7+ let randomNum = randomNumber ( ) ;
8+ const arithmeticProgression = randomNumber ( 5 ) + 1 ;
9+ const progression = [ randomNum ] ;
810 for ( let i = 0 ; i < 10 ; i += 1 ) {
9- progression . push ( randomNumber ( ) ) ;
11+ randomNum += arithmeticProgression ;
12+ progression . push ( randomNum ) ;
1013 }
11- const arithmeticProgression = progression . sort ( ( a , b ) => a - b ) ;
1214 const hiddenNum = randomNumber ( 10 ) ;
13- const correctAnswer = arithmeticProgression [ hiddenNum ] ;
14- arithmeticProgression [ hiddenNum ] = '..' ;
15+ const correctAnswer = progression [ hiddenNum ] ;
16+ progression [ hiddenNum ] = '..' ;
1517 let question = '' ;
16- arithmeticProgression . forEach ( ( element ) => {
18+ progression . forEach ( ( element ) => {
1719 question += `${ element } ` ;
1820 } ) ;
1921 return [ question , String ( correctAnswer ) ] ;
You can’t perform that action at this time.
0 commit comments