introduce bitloops

This commit is contained in:
mike
2026-01-14 09:59:24 +01:00
parent 1a56297986
commit 69af69a8b8
3 changed files with 36 additions and 32 deletions

View File

@@ -77,7 +77,10 @@ public class SwedishGeneratorTest {
static final byte D_BYTE_2 = CLUE_RIGHT;
@Test
void testPatternForSlotAllLetters() {
var grid = new Grid(new byte[]{ LETTER_A, LETTER_B, LETTER_C }, 0, 0);
var grid = createEmpty();
grid.setLetter(0, LETTER_A);
grid.setLetter(1, LETTER_B);
grid.setLetter(2, LETTER_C);
var slot = Slot.from(18 << Slot.BIT_FOR_DIR | (CLUE_RIGHT), 7L, 0L);
var pattern = patternForSlot(grid, slot);
@@ -86,7 +89,9 @@ public class SwedishGeneratorTest {
@Test
void testPatternForSlotMixed() {
var grid = new Grid(new byte[]{ LETTER_A, DASH, LETTER_C }, 0, 0);
var grid = createEmpty();
grid.setLetter(0, LETTER_A);
grid.setLetter(2, LETTER_C);
var slot = Slot.from(1 << Slot.BIT_FOR_DIR | (CLUE_RIGHT), 7L, 0L);
var pattern = patternForSlot(grid, slot);
@@ -95,7 +100,7 @@ public class SwedishGeneratorTest {
@Test
void testPatternForSlotAllDashes() {
var grid = new Grid(new byte[]{ DASH, DASH, DASH }, 0, 0); // - - -
var grid = createEmpty();
var slot = Slot.from(1 << Slot.BIT_FOR_DIR | (CLUE_RIGHT), 7L, 0L);
var pattern = patternForSlot(grid, slot);
@@ -104,7 +109,8 @@ public class SwedishGeneratorTest {
@Test
void testPatternForSlotSingleLetter() {
var grid = new Grid(new byte[]{ LETTER_A, DASH, DASH }, 0, 0);
var grid = createEmpty();
grid.setLetter(0, LETTER_A);
var slot = Slot.from(1 << Slot.BIT_FOR_DIR | (CLUE_RIGHT), 7L, 0L);
var pattern = patternForSlot(grid, slot);