This commit is contained in:
mike
2026-01-23 04:02:51 +01:00
parent ed7cade1c7
commit 4109c51cbe
8 changed files with 54 additions and 39 deletions

View File

@@ -38,9 +38,9 @@ import static java.nio.charset.StandardCharsets.US_ASCII;
public record SwedishGenerator() {
public static final int MAX_TRIES_PER_SLOT = 500;// MAX_TRIES_PER_SLOT;
public static final long X = 0L;
@Shaped private static final int SIZE = Neighbors9x8.SIZE;
@Shaped private static final long RANGE_0_SIZE = Neighbors9x8.RANGE_0_SIZE;
public static final long X = 0L;
@Shaped static final int SIZE = Neighbors9x8.SIZE;
@Shaped private static final long RANGE_0_SIZE = Neighbors9x8.RANGE_0_SIZE;
@Shaped private static final long RANGE_0_624 = Neighbors9x8.RANGE_0_624;
interface Bit1029 {
@@ -118,14 +118,6 @@ public record SwedishGenerator() {
return k;
}
public static boolean increasing(int dir) { return (dir & 2) == 0; }
public static Grid grid(Slotinfo[] slots) {
long lo = X, hi = X;
for (var slot : slots) {
lo |= slot.lo;
hi |= slot.hi;
}
return new Grid(new byte[SIZE], ~lo, ~hi);
}
}
public static long patternForSlot(final long glo, final long ghi, final byte[] g, final long lo, final long hi) {