introduce bitloops

This commit is contained in:
mike
2026-01-17 13:22:04 +01:00
parent 0c56fafeaa
commit 9102dcb922
10 changed files with 706 additions and 82 deletions

View File

@@ -10,9 +10,11 @@ import puzzle.Export.PuzzleResult;
import puzzle.Export.Rewards;
import puzzle.SwedishGenerator.Assign;
import puzzle.SwedishGenerator.FillResult;
import puzzle.SwedishGenerator.Lemma;
import puzzle.SwedishGenerator.Slotinfo;
import puzzle.SwedishGeneratorTest.Idx;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -69,7 +71,7 @@ public class ExportFormatTest {
var fillResult = new FillResult(true, 0, 0, 0, 0, new FillStats());
var puzzleResult = new PuzzleResult(new Clued(clues), grid, new Slotinfo[]{
new Slotinfo(key, lo, 0L, 0, new Assign(TEST), null)
new Slotinfo(key, lo, 0L, 0, new Assign(TEST, 0), null)
}, fillResult);
var rewards = new Rewards(10, 5, 1);
@@ -134,5 +136,15 @@ public class ExportFormatTest {
throw new RuntimeException(e);
}
}
@Test
void testShardToClue() {
val index = 1;
val word = DictData.DICT.index()[3].words()[index];
val assigned = new Assign(word, index);
val lemma = Lemma.unpackIndex(word);
var word1 = Lemma.asWord(word);
val shard = Meta.shardKey(assigned.w);
val clue = Meta.readRecord(shard, index);
assertNotNull(clue);
}
}