introduce bitloops
This commit is contained in:
@@ -129,7 +129,6 @@ public record Export() {
|
||||
|
||||
static class Bit {
|
||||
|
||||
static long pack(int r, int c) { return (((long) r) << 32) ^ (c & 0xFFFFFFFFL); }
|
||||
long l1, l2;
|
||||
public boolean get(int bitIndex) {
|
||||
if ((bitIndex & 64) == 0) return (l1 & (1L << bitIndex)) != 0L;
|
||||
|
||||
@@ -64,7 +64,6 @@ public record SwedishGenerator(Rng rng) {
|
||||
|
||||
static final byte B0 = (byte) 0;
|
||||
static final byte B64 = (byte) 64;
|
||||
static final byte B48 = (byte) 48;
|
||||
static final long[] OFFSETS_D_IDX = Neighbors9x8.OFFSET_D_IDX;
|
||||
static final rci[] IT = Neighbors9x8.IT;
|
||||
static final int[][] MUTATE_RI = new int[SIZE][625];
|
||||
@@ -314,10 +313,8 @@ public record SwedishGenerator(Rng rng) {
|
||||
static Slot from(int key, long lo, long hi) { return new Slot(key, lo, hi); }
|
||||
|
||||
public int len() { return Long.bitCount(lo) + Long.bitCount(hi); }
|
||||
public int clueR() { return Grid.r((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 static int dir(int key) { return key & 7; }
|
||||
public boolean horiz() { return horiz(key); }
|
||||
public boolean reversed() { return (key & 2) == 0; }
|
||||
|
||||
Reference in New Issue
Block a user