|
4 | 4 | import hexlet.code.Utils; |
5 | 5 |
|
6 | 6 | public class Progression { |
| 7 | + private static final int PROGRESSION_LENGTH = 10; |
| 8 | + private static final int STEP_MIN = 1; |
| 9 | + private static final int STEP_MAX = 10; |
| 10 | + private static final int FIRST_NUM_MIN = 1; |
| 11 | + private static final int FIRST_NUM_MAX = 100; |
| 12 | + private static final int HIDDEN_MIN = 1; |
| 13 | + private static final int HIDDEN_MAX = 10; |
7 | 14 | public static void startGame() { |
8 | | - final int PROGRESSION_LENGTH = 10; |
| 15 | + |
| 16 | + |
9 | 17 | String[][] roundsData = new String[Engine.ROUNDS][2]; |
10 | 18 | String description = "What number is missing in the progression?"; |
11 | 19 |
|
12 | 20 | for (int i = 0; i < Engine.ROUNDS; i++) { |
13 | 21 | String[] progression = makeProgression( |
14 | | - Utils.generateNumber(1, 100), |
15 | | - Utils.generateNumber(1, 10), PROGRESSION_LENGTH); |
16 | | - int hiddenMemberIndex = Utils.generateNumber(0, 9); |
| 22 | + Utils.generateNumber(FIRST_NUM_MIN, FIRST_NUM_MAX), |
| 23 | + Utils.generateNumber(STEP_MIN, STEP_MAX), PROGRESSION_LENGTH); |
| 24 | + int hiddenMemberIndex = Utils.generateNumber(HIDDEN_MIN, HIDDEN_MAX); |
17 | 25 | String answer = progression[hiddenMemberIndex]; |
18 | 26 |
|
19 | 27 | progression[hiddenMemberIndex] = ".."; |
|
0 commit comments