introduce bitloops

This commit is contained in:
mike
2026-01-19 16:31:33 +01:00
parent 37581d15b4
commit 1fa112ab65
14 changed files with 393 additions and 455 deletions

View File

@@ -11,7 +11,7 @@ public class CornerClueTest {
void testCornerDownSlot() {
Clues clues = Clues.createEmpty();
// Clue op (0,0), type 4 (Corner Down)
int idx = SwedishGenerator.Grid.offset(0,0);
int idx = Masker.offset(0, 0);
clues.setClueLo(1L << idx, (byte)4);
assertEquals(4, clues.getDir(idx));
@@ -22,10 +22,10 @@ public class CornerClueTest {
if (Masker.Slot.dir(key) == 4) {
found[0] = true;
// Woord zou moeten starten op (0,1)
int startIdx = SwedishGenerator.Grid.offset(0, 1);
int startIdx = Masker.offset(0, 1);
assertTrue((lo & (1L << startIdx)) != 0, "Slot should start at (0,1)");
// En omlaag gaan
int secondIdx = SwedishGenerator.Grid.offset(1, 1);
int secondIdx = Masker.offset(1, 1);
assertTrue((lo & (1L << secondIdx)) != 0, "Slot should continue to (1,1)");
// Lengte van het slot zou 8 moeten zijn (van rij 0 t/m 7 in kolom 1)
@@ -38,7 +38,7 @@ public class CornerClueTest {
@Test
void testCornerDownExtraction() {
Clues clues = Clues.createEmpty();
int idx = SwedishGenerator.Grid.offset(0,0);
int idx = Masker.offset(0, 0);
clues.setClueLo(1L << idx, (byte)4);
DictEntry[] dict = DictData.DICT.index();