introduce bitloops

This commit is contained in:
mike
2026-01-20 01:35:34 +01:00
parent 5678af332e
commit 7e5e363a3e
7 changed files with 74 additions and 51 deletions

View File

@@ -18,8 +18,8 @@ import static puzzle.SwedishGeneratorTest.Idx.IDX_0_0;
public class SwedishGeneratorTest {
public static final char C_DASH = '\0';
public static final byte DASH = (byte) C_DASH;
public static final char C_DASH = '\0';
public static final byte DASH = (byte) C_DASH;
static Grid createEmpty() { return new Grid(new byte[SIZE], X, X); }
record Context(long[] bitset) {
@@ -29,19 +29,19 @@ public class SwedishGeneratorTest {
public static Context get() { return CTX.get(); }
}
static final long TEST = Lemma.from("TEST");
static final long IN = Lemma.from("IN");
static final long INER = Lemma.from("INER");
static final long INEREN = Lemma.from("INEREN");
static final long INERENA = Lemma.from("INERENA");
static final long INERENAE = Lemma.from("INERENAE");
static final long APPLE = Lemma.from("APPLE");
static final long EXE = Lemma.from("AXE");
static final long ABC = Lemma.from("ABC");
static final long ABD = Lemma.from("ABD");
static final long AZ = Lemma.from("AZ");
static final long AB = Lemma.from("AB");
static final long[] WORDS = new long[]{
static final long TEST = Lemma.from("TEST");
static final long IN = Lemma.from("IN");
static final long INER = Lemma.from("INER");
static final long INEREN = Lemma.from("INEREN");
static final long INERENA = Lemma.from("INERENA");
static final long INERENAE = Lemma.from("INERENAE");
static final long APPLE = Lemma.from("APPLE");
static final long EXE = Lemma.from("AXE");
static final long ABC = Lemma.from("ABC");
static final long ABD = Lemma.from("ABD");
static final long AZ = Lemma.from("AZ");
static final long AB = Lemma.from("AB");
static final long[] WORDS = new long[]{
Lemma.from("AT"),
Lemma.from("CAT"),
Lemma.from("DOGS"),
@@ -196,7 +196,7 @@ public class SwedishGeneratorTest {
assertEquals(val1, rng2.nextU32());
for (var i = 0; i < 100; i++) {
var r = rng.randint(6);
var r = rng.randomClueDir();
assertTrue(r >= 0 && r <= 5);
var f = rng.nextFloat();
assertTrue(f >= 0.0 && f <= 1.0);