@@ -7,23 +7,24 @@ const numberStart = randomNumber(1, 50);
77const step = randomNumber ( 1 , 9 ) ;
88const endRange = numberStart + ( step * 10 ) ;
99const guessIndex = randomNumber ( 0 , 9 ) ;
10+ const progressionConst = range ( numberStart , endRange , step ) ;
11+
12+ // const progressGame = (arr, num) => {
13+ // const guessNumber = () => arr[num];
14+ // const progression = [arr.slice(0, num), '..', arr.slice(num + 1)].join(' ');
15+ // const questionProgressGame = () => progression;
16+ // return [questionProgressGame, guessNumber];
1017
1118const progressGame = ( ) => {
12- const progressionConst = range ( numberStart , endRange , step ) ;
13- const guessNumber = progressionConst [ guessIndex ] ;
14- const progression = progressionConst ;
15- progression [ guessIndex ] = '..' ;
16- const questionProgressGame = progression . join ( ' ' ) ;
19+ const guessNumber = ( ) => progressionConst [ guessIndex ] ;
20+ const progression = [ progressionConst . slice ( 0 , guessIndex ) , '..' , progressionConst . slice ( guessIndex + 1 ) ] . join ( ' ' ) ;
21+ const questionProgressGame = ( ) => progression ;
1722 return [ questionProgressGame , guessNumber ] ;
1823} ;
1924
20- const [ a , b ] = progressGame ( ) ;
21-
22- const questionProgressGame = ( ) => a ;
23-
24- const correctAnswer = ( ) => b ;
25+ // const exp = () => {
26+ // progressGame(progressionConst, guessIndex);
27+ // };
28+ // не до делал чтобы вызвать функция со значениями.
2529
26-
27- export default ( ) => {
28- gameGo ( ruleProgressGame , questionProgressGame , correctAnswer ) ;
29- } ;
30+ export default ( ) => gameGo ( ruleProgressGame , progressGame ) ;
0 commit comments