|
1 | 1 | package com.ndn; |
2 | 2 |
|
| 3 | +import com.google.api.detect.Detect; |
| 4 | +import com.google.api.detect.DetectResult; |
| 5 | +import com.google.api.translate.Language; |
| 6 | +import com.google.api.translate.Translate; |
3 | 7 | import com.ndn.map.*; |
| 8 | +import com.sun.java.accessibility.util.Translator; |
| 9 | +import org.apache.http.HttpEntity; |
| 10 | +import org.apache.http.HttpResponse; |
| 11 | +import org.apache.http.NameValuePair; |
| 12 | +import org.apache.http.client.HttpClient; |
| 13 | +import org.apache.http.client.entity.UrlEncodedFormEntity; |
| 14 | +import org.apache.http.client.methods.HttpGet; |
| 15 | +import org.apache.http.client.methods.HttpPost; |
| 16 | +import org.apache.http.impl.client.HttpClients; |
| 17 | +import org.apache.http.message.BasicNameValuePair; |
4 | 18 |
|
5 | 19 | import java.io.*; |
6 | 20 | import java.nio.charset.StandardCharsets; |
7 | 21 | import java.util.ArrayList; |
8 | 22 | import java.util.Comparator; |
| 23 | +import java.util.List; |
9 | 24 |
|
10 | 25 | // generates sudoku puzzles and print to file text. |
11 | 26 | public class Run { |
12 | 27 |
|
13 | 28 | static void randomAndSaveToFile(){ |
14 | 29 | // properties |
15 | 30 | int level = 16; |
16 | | - int numberOfLessons = 300; |
| 31 | + int numberOfLessons = 100; |
17 | 32 | int minScore = 1; |
18 | 33 | int maxScore = 10000000; |
19 | | - String path = "result/sudoku16x16/Level_5.txt"; |
| 34 | + String path = "result/sudoku16x16/Gen.txt"; |
20 | 35 |
|
21 | 36 | //cac cac cac |
22 | 37 | ArrayList<Map> maps = new ArrayList<>(); |
23 | 38 | while (numberOfLessons > 0) { |
24 | | - Map map = Generator.generateRandomMap(level, 30000, minScore, maxScore); |
| 39 | + Map map = Generator.generateRandomMap(level, 5000, minScore, maxScore); |
25 | 40 | System.out.println(map.getScore()); |
26 | 41 | System.out.println(map); |
27 | 42 | if(map.getScore() >= minScore && map.getScore() <= maxScore) { |
@@ -54,7 +69,7 @@ static void randomAndSaveToFile(){ |
54 | 69 | e.printStackTrace(); |
55 | 70 | } |
56 | 71 | } |
57 | | - public static void main(String... args) { |
| 72 | + public static void main(String... args) throws Exception { |
58 | 73 | randomAndSaveToFile(); |
59 | 74 | } |
60 | 75 | } |
0 commit comments