introduce bitloops

This commit is contained in:
mike
2026-01-14 12:28:07 +01:00
parent 6afe675a9d
commit dfb4679da8
5 changed files with 49 additions and 44 deletions

View File

@@ -6,6 +6,7 @@ import lombok.experimental.Delegate;
import lombok.val;
import puzzle.Export.Gridded.Replacar.Cell;
import puzzle.SwedishGenerator.Clues;
import puzzle.SwedishGenerator.DictEntry;
import puzzle.SwedishGenerator.FillResult;
import puzzle.SwedishGenerator.Grid;
import java.util.ArrayList;
@@ -197,10 +198,11 @@ public record Export() {
var g = filled().grid();
var placed = new ArrayList<Placed>();
var clueMap = filled().clueMap();
val entries = new DictEntry[10];
mask.forEachSlot((int key, long lo, long hi) -> {
var word = clueMap[key];
if (word != 0L) {
placed.add(extractPlacedFromSlot(Slot.from(key, lo, hi), word));
placed.add(extractPlacedFromSlot(Slot.from(key, lo, hi, entries[Slot.length(lo, hi)]), word));
} else {
System.err.println("Could not find clue for slot: " + key);
}