introduce bitloops
This commit is contained in:
@@ -13,9 +13,9 @@ import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static puzzle.CsvIndexService.SC;
|
||||
import static puzzle.Export.*;
|
||||
import static puzzle.SwedishGenerator.*;
|
||||
import static puzzle.SwedishGenerator.Dict.GSON;
|
||||
import static puzzle.SwedishGenerator.Dict.loadDict;
|
||||
|
||||
public class Main {
|
||||
@@ -53,6 +53,11 @@ public class Main {
|
||||
}
|
||||
|
||||
public void main(String[] args) {
|
||||
var csv = Paths.get("nl_score_hints_v3.csv");
|
||||
var idx = Paths.get("nl_score_hints_v3.idx");
|
||||
ScopedValue.where(SC, new CsvIndexService(csv, idx)).run(() -> _main(args));
|
||||
}
|
||||
public void _main(String[] args) {
|
||||
var opts = parseArgs(args);
|
||||
|
||||
if (opts.reindex) {
|
||||
@@ -69,6 +74,8 @@ public class Main {
|
||||
|
||||
section("Settings");
|
||||
printSettings(opts);
|
||||
var csv = Paths.get("nl_score_hints_v3.csv");
|
||||
var idx = Paths.get("nl_score_hints_v3.idx");
|
||||
|
||||
var res = generatePuzzle(opts);
|
||||
if (res == null) {
|
||||
@@ -377,7 +384,7 @@ public class Main {
|
||||
|
||||
record JsonExportedPuzzle(String date, String theme, int difficulty, Rewards rewards, String[] grid, WordOut[] words) { }
|
||||
private static String toJson(ExportedPuzzle puzzle, String date, String theme) {
|
||||
return GSON.toJson(new JsonExportedPuzzle(date, theme, puzzle.difficulty(), puzzle.rewards(), puzzle.gridv2(), puzzle.words()));
|
||||
return CsvIndexService.GSON.toJson(new JsonExportedPuzzle(date, theme, puzzle.difficulty(), puzzle.rewards(), puzzle.gridv2(), puzzle.words()));
|
||||
}
|
||||
|
||||
private static String escapeJson(String s) {
|
||||
|
||||
Reference in New Issue
Block a user