We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf0c405 commit 991a1bdCopy full SHA for 991a1bd
app/src/main/java/hexlet/code/games/Prime.java
@@ -5,6 +5,7 @@
5
import java.util.Random;
6
7
public class Prime {
8
+ static final int SECONDUSUALNUMBER = 3;
9
public static String[][] generateQA() {
10
Random random = new Random();
11
String[][] questionAnswer = new String[Engine.MAXROUNDCOUNTER][2];
@@ -25,7 +26,7 @@ public static String isPrime(int number) {
25
26
if (number % 2 == 0) {
27
return "no";
28
}
- for (int i = 3; i < (int) Math.sqrt(number); i += 2) {
29
+ for (int i = SECONDUSUALNUMBER; i < (int) Math.sqrt(number); i += 2) {
30
if (number % i == 0) {
31
32
0 commit comments