introduce bitloops
This commit is contained in:
@@ -538,8 +538,7 @@ public record SwedishGenerator(Rng rng) {
|
|||||||
idx = rng.randint(0, SIZE_MIN_1);
|
idx = rng.randint(0, SIZE_MIN_1);
|
||||||
if (g.isClue(idx)) continue;
|
if (g.isClue(idx)) continue;
|
||||||
int d_idx = rng.randint2bit();
|
int d_idx = rng.randint2bit();
|
||||||
val packed = OFFSETS_D_IDX[d_idx | idx << 2];
|
if (g.hasRoomForClue(OFFSETS_D_IDX[d_idx | idx << 2])) {
|
||||||
if (g.hasRoomForClue(packed)) {
|
|
||||||
g.setClue(idx, (byte) (1 + (d_idx | 48)));
|
g.setClue(idx, (byte) (1 + (d_idx | 48)));
|
||||||
placed++;
|
placed++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user