introduce bitloops
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
package puzzle;
|
||||
|
||||
import module java.base;
|
||||
import anno.DictGen;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.val;
|
||||
import puzzle.Masker.Clues;
|
||||
import puzzle.SwedishGenerator.Rng;
|
||||
|
||||
import static puzzle.Export.*;
|
||||
import static puzzle.SwedishGenerator.*;
|
||||
|
||||
@DictGen(
|
||||
packageName = "puzzle.dict800",
|
||||
className = "DictData800",
|
||||
scv = "/home/mike/dev/puzzle-generator/nl_score_hints_v4.csv",
|
||||
simpleMax = 800,
|
||||
minLen = 2,
|
||||
maxLen = 8
|
||||
)
|
||||
public class Main {
|
||||
|
||||
final static String OUT_DIR = envOrDefault("OUT_DIR", "/data/puzzle");
|
||||
@@ -50,6 +59,7 @@ public class Main {
|
||||
void main(String[] args) {
|
||||
_main(args);
|
||||
}
|
||||
@SneakyThrows
|
||||
public void _main(String[] args) {
|
||||
var opts = parseArgs(args);
|
||||
|
||||
@@ -245,7 +255,7 @@ public class Main {
|
||||
PuzzleResult generatePuzzle(Opts opts) {
|
||||
|
||||
var tLoad0 = System.nanoTime();
|
||||
var dict = puzzle.dict800.DictData.DICT800;//loadDict(opts.wordsPath);
|
||||
Dict dict = puzzle.dict800.DictData800.DICT800;//loadDict(opts.wordsPath);
|
||||
var tLoad1 = System.nanoTime();
|
||||
|
||||
section("Load");
|
||||
@@ -365,7 +375,7 @@ public class Main {
|
||||
var filled = fillMask(rng, slotInfo, grid);
|
||||
|
||||
if (!multiThreaded) {
|
||||
System.out.print("\r" + Strings.padRight("", 120) + "\r");
|
||||
System.out.print("\r" + " ".repeat(120 - "".length()) + "\r");
|
||||
System.out.flush();
|
||||
}
|
||||
// print a final progress line
|
||||
@@ -395,7 +405,7 @@ public class Main {
|
||||
//System.out.println(Arrays.stream(new Clued(mask).gridToString().split("\n")).map(s -> "\"" + s + "\\n\" +").collect(Collectors.joining("\n")));
|
||||
}
|
||||
if (filled.ok()) {
|
||||
return new PuzzleResult(new Clued(mask), new Gridded(grid, mask), slotInfo, filled);
|
||||
return new PuzzleResult(new Signa(mask), new Puzzle(grid, mask), slotInfo, filled);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user