@@ -12,17 +12,17 @@ public static void gameLogic() {
1212 Engine .userGreetings ();
1313 System .out .println ("What number is missing in the progression?" );
1414 while (Engine .questionCounter != 3 ) {
15- int progressionStep = randNum .nextInt (1 ,10 );
16- int randHideElement = randNum .nextInt (0 ,9 );
17- int firstNum = randNum .nextInt (1 ,100 );
15+ int progressionStep = randNum .nextInt (1 , 10 );
16+ int randHideElement = randNum .nextInt (0 , 9 );
17+ int firstNum = randNum .nextInt (1 , 100 );
1818 progression [0 ] = firstNum ;
19- for (int i = 1 ; i < progression .length ; i ++) {
19+ for (int i = 1 ; i < progression .length ; i ++) {
2020 progression [i ] = progression [i - 1 ] + progressionStep ;
2121 }
2222 int hideElement = progression [randHideElement ];
2323 String [] progressionWithDots = new String [progression .length ];
24- for (int i = 0 ; i < progression .length ; i ++) {
25- if (i == randHideElement ) {
24+ for (int i = 0 ; i < progression .length ; i ++) {
25+ if (i == randHideElement ) {
2626 progressionWithDots [i ] = "..." ;
2727 } else {
2828 progressionWithDots [i ] = String .valueOf (progression [i ]);
@@ -36,10 +36,11 @@ public static void gameLogic() {
3636 Engine .questionCounter ++;
3737 } else {
3838 System .out .println ("Your answer: " + answer );
39- System .out .println ("'" + answer + "'" + "is wrong answer ;(. " +
40- "Correct answer was" + "'" + hideElement + "'" );
39+ System .out .println ("'" + answer + "'" + "is wrong answer ;(. "
40+ + "Correct answer was" + "'" + hideElement + "'" );
41+ break ;
4142 }
42- if (Engine .questionCounter == 3 ) {
43+ if (Engine .questionCounter == 3 ) {
4344 System .out .println ("Congratulations, " + Engine .userName + "!" );
4445 }
4546 }
0 commit comments