introduce bitloops

This commit is contained in:
mike
2026-01-20 07:08:31 +01:00
parent 47ead135d3
commit a764f45041
83 changed files with 205106 additions and 175 deletions

View File

@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.val;
import puzzle.Masker.Clues;
import puzzle.SwedishGenerator.Rng;
import puzzle.dict800.DictData;
import static puzzle.Export.*;
import static puzzle.SwedishGenerator.*;
@@ -79,7 +80,7 @@ public class Main {
}
section("Result");
res.filled().stats().simplicity = PuzzleResult.calcSimpel(res.slots());
res.filled().stats().simplicity = res.calcSimpel(res.slots());
info(String.format(Locale.ROOT, "simplicity : %.2f", res.filled().stats().simplicity));
section("Mask");
@@ -256,7 +257,7 @@ public class Main {
PuzzleResult generatePuzzle(Opts opts) {
var tLoad0 = System.nanoTime();
var dict = DictData.DICT;//loadDict(opts.wordsPath);
var dict = DictData.DICT800;//loadDict(opts.wordsPath);
var tLoad1 = System.nanoTime();
section("Load");
@@ -394,7 +395,7 @@ public class Main {
TOTAL_NODES.addAndGet(filled.nodes());
TOTAL_BACKTRACKS.addAndGet(filled.backtracks());
if (filled.ok()) {
val simpel = PuzzleResult.calcSimpel(slotInfo);
val simpel = PuzzleResult.calcSimpel(THRESS,slotInfo);
TOTAL_SUCCESS.incrementAndGet();
TOTAL_SIMPLICITY.addAndGet(simpel * 100);
}
@@ -413,7 +414,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() && (opts.minSimplicity <= 0 || filled.stats().simplicity >= opts.minSimplicity)) {
return new PuzzleResult(new Clued(mask), new Gridded(grid, mask), slotInfo, filled);
return new PuzzleResult(new Clued(mask), new Gridded(grid, mask), slotInfo, filled, THRESS);
}
if (opts.verbose && filled.ok()) {