introduce bitloops

This commit is contained in:
mike
2026-01-12 09:23:38 +01:00
parent fdd1c76bae
commit 84e832df40
7 changed files with 96 additions and 80 deletions

View File

@@ -30,9 +30,8 @@ public class ExportFormatTest {
var clueMap = new HashMap<Integer, Long>();
// key = (cellIndex << 4) | direction
var key = (0 << 4) | 2;
var lemma = new Lemma("TEST");
clueMap.put(key, lemma.word());
var key = 2;
clueMap.put(key, new Lemma("TEST").word());
// Manually fill the grid letters for "TEST" at (0,1), (0,2), (0,3), (0,4)
grid.setLetter(Grid.offset(0, 1), (byte) 'T');
@@ -74,8 +73,8 @@ public class ExportFormatTest {
// letterAt only contains letters from placed words.
// arrow cells are NOT in letterAt unless they are also part of a word (unlikely).
// So (0,0) should be '#'
assertEquals(1, exported.gridv2().length);
assertEquals("#TEST", exported.gridv2()[0]);
assertEquals(1, exported.grid().length);
assertEquals("#TEST", exported.grid()[0]);
}
@Test
@@ -90,8 +89,8 @@ public class ExportFormatTest {
assertNotNull(exported);
assertEquals(0, exported.words().length);
// Should return full grid with '#'
assertEquals(R, exported.gridv2().length);
for (var row : exported.gridv2()) {
assertEquals(R, exported.grid().length);
for (var row : exported.grid()) {
assertEquals(C, row.length());
assertTrue(row.matches("#+"));
}