File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/main/java/hexlet/code/games Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11package hexlet .code .games ;
22
3+ import hexlet .code .Engine ;
4+
35import java .util .Random ;
46
57public class Prime {
68 public static String [][] generateQA () {
79 Random random = new Random ();
8- String [][] questionAnswer = new String [3 ][2 ];
10+ String [][] questionAnswer = new String [Engine . MAXROUNDCOUNTER ][2 ];
911 for (int i = 0 ; i < questionAnswer .length ; i ++) {
10- questionAnswer [i ][0 ] = String .valueOf (random .nextInt (100 ));
12+ questionAnswer [i ][0 ] = String .valueOf (random .nextInt (Engine . MAXRANDOMNUMBER ));
1113 questionAnswer [i ][1 ] = isPrime (Integer .parseInt (questionAnswer [i ][0 ]));
1214 }
1315 return questionAnswer ;
@@ -23,7 +25,7 @@ public static String isPrime(int number) {
2325 if (number % 2 == 0 ) {
2426 return "no" ;
2527 }
26- for (int i = 3 ; i < (int ) Math .sqrt (number ); i += 2 ) {
28+ for (int i = 3 ; i < (int ) Math .sqrt (number ); i += 2 ) {
2729 if (number % i == 0 ) {
2830 return "no" ;
2931 }
You can’t perform that action at this time.
0 commit comments