introduce bitloops
This commit is contained in:
@@ -119,7 +119,7 @@ public record SwedishGenerator(Rng rng) {
|
||||
final int[] stack = new int[SIZE];
|
||||
final Bit seen = new Bit();
|
||||
long pattern;
|
||||
final long[] undo = new long[4096];
|
||||
final long[] undo = new long[128];
|
||||
final long[] bitset = new long[2500];
|
||||
|
||||
void setPattern(long p) { this.pattern = p; }
|
||||
@@ -207,9 +207,6 @@ public record SwedishGenerator(Rng rng) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static boolean isLetter(byte b) { return (b & B64) != B0; }
|
||||
public boolean isLetterSet(int idx) { return isLetter(g[idx]); }
|
||||
|
||||
public double similarity(Grid b) {
|
||||
var same = 0;
|
||||
for (int i = 0; i < SIZE; i++) if (g[i] == b.g[i]) same++;
|
||||
@@ -318,7 +315,8 @@ public record SwedishGenerator(Rng rng) {
|
||||
|
||||
public int len() { return Long.bitCount(lo) + Long.bitCount(hi); }
|
||||
public int clueR() { return Grid.r((key >>> BIT_FOR_DIR)); }
|
||||
public int clueIndex() { return key >>> BIT_FOR_DIR; }
|
||||
public int clueIndex() { return clueIndex(key); }
|
||||
public static int clueIndex(int key) { return key >>> BIT_FOR_DIR; }
|
||||
public int clueC() { return Grid.c((key >>> BIT_FOR_DIR)); }
|
||||
public int dir() { return key & 7; }
|
||||
public boolean horiz() { return horiz(key); }
|
||||
|
||||
Reference in New Issue
Block a user