introduce bitloops

This commit is contained in:
mike
2026-01-17 01:15:03 +01:00
parent 60b7509bf6
commit 4585c1f2eb
3 changed files with 146 additions and 120 deletions

View File

@@ -180,9 +180,9 @@ public class MainTest {
128L,
422762372923520L,
192L);
var filled = fillMask(rng, extractSlots(mask, dict.index()), mask.toGrid());
var filled = fillMask(rng, extractSlots(mask, dict.index()), mask.toGrid(), false);
Assertions.assertTrue(filled.ok(), "Puzzle generation failed (not ok)");
Assertions.assertEquals(18, filled.wordCount(), "Number of assigned words changed");
Assertions.assertEquals(18, filled.wordCount(0), "Number of assigned words changed");
Assertions.assertEquals("SLEDE", Lemma.asWord(filled.clueMap()[282]));
Assertions.assertEquals(-1L, filled.grid().grid().lo);
Assertions.assertEquals(255L, filled.grid().grid().hi);
@@ -201,7 +201,7 @@ public class MainTest {
foundSeed = seed;
System.out.println("[DEBUG_LOG] Seed found: " + seed);
System.out.println("[DEBUG_LOG] Simplicity: " + res.filled().stats().simplicity);
System.out.println("[DEBUG_LOG] ClueMap Size: " + res.filled().wordCount());
System.out.println("[DEBUG_LOG] ClueMap Size: " + res.filled().wordCount(0));
System.out.println("[DEBUG_LOG] Grid:");
System.out.println(res.filled().grid().renderHuman(res.clues().c()));
System.out.println(res.filled().grid().gridToString(res.clues().c()));
@@ -214,15 +214,8 @@ public class MainTest {
Assertions.assertTrue(res.filled().ok(), "Puzzle generation failed (not ok)");
Assertions.assertEquals(12348, foundSeed, "Found seed changed");
}
boolean isLetter(byte b) { return (b & 64) != 0; }
@Test
public void testIsLetterA() {
assertTrue(isLetter((byte) 'A'));
}
@Test
public void testIsLetterZ() {
assertTrue(isLetter((byte) 'Z'));
}
boolean isLetter(byte b) { return (b & 64) != 0; }
@Test public void testIsLetterA() { assertTrue(isLetter((byte) 'A')); }
@Test public void testIsLetterZ() { assertTrue(isLetter((byte) 'Z')); }
}