introduce bitloops

This commit is contained in:
mike
2026-01-17 16:37:48 +01:00
parent c76d463c8c
commit 9367833407
38 changed files with 147 additions and 93 deletions

View File

@@ -71,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, 0), null)
new Slotinfo(key, lo, 0L, 0, new Assign(TEST), null)
}, fillResult);
var rewards = new Rewards(10, 5, 1);
@@ -134,7 +134,7 @@ public class ExportFormatTest {
for (int i = 0; i < Math.min(words.length, 5); i++) {
val wordVal = words[i];
val word = Lemma.asWord(wordVal);
val assigned = new Assign(wordVal, i);
val assigned = new Assign(wordVal);
val shard = Meta.shardKey(assigned.w);
val clueRec = Meta.readRecord(shard, i);
@@ -149,15 +149,15 @@ public class ExportFormatTest {
@Test
void testSpecificWords() {
// These words are known to be in the CSV and likely in the dictionary
String[] testWords = {"EEN", "NAAR", "IEDEREEN"};
String[] testWords = { "EEN", "NAAR", "IEDEREEN" };
for (String wStr : testWords) {
long w = Lemma.pack(wStr);
int L = wStr.length();
var entry = DictData.DICT.index()[L];
long w = Lemma.pack(wStr);
int L = wStr.length();
var entry = DictData.DICT.index()[L];
if (entry == null) continue;
// Find index of word in entry
int idx = -1;
int idx = -1;
long[] words = entry.words();
for (int i = 0; i < words.length; i++) {
if (Lemma.asWord(words[i]).equals(wStr)) {
@@ -167,8 +167,8 @@ public class ExportFormatTest {
}
if (idx != -1) {
val shard = Meta.shardKey(w);
val clueRec = Meta.readRecord(shard, idx);
val shard = Meta.shardKey(w);
val clueRec = Meta.readRecord(shard, idx);
assertNotNull(clueRec);
assertEquals(wStr, Lemma.asWord(clueRec.w()));
// Check some expected complexity values (from CSV head output, column 3)