-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.java
27 lines (18 loc) · 831 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ai.my_excersises_based_on_package.eightqueens_backtrack;
import java.util.Random;
public class Main {
public static void main(String[] args) {
EightQueen eightQueen = new EightQueen();
eightQueen.solve();
for (int i = 0; i < eightQueen.getBoard().length; i++) {
for (int j = 0; j < eightQueen.getBoard()[i].length; j++) {
String s1 = ThreadColor.values()[new Random().nextInt(ThreadColor.values().length)].getColor();
if (eightQueen.getBoard()[i][j] == 0)
System.out.printf("%s%d ", ThreadColor.ANSI_RESET.getColor(), eightQueen.getBoard()[i][j]);
else
System.out.printf("%s%d ", s1, eightQueen.getBoard()[i][j]);
}
System.out.println();
}
}
}