Gather data

This commit is contained in:
mike
2026-01-09 10:01:59 +01:00
parent 171ea60636
commit 2402ab0f68
3 changed files with 15 additions and 16 deletions

View File

@@ -379,8 +379,9 @@ public record SwedishGenerator(int[] buff) {
}
public int len() { return (int) (packedPos >>> 56); }
public int clueR() { return (key >> 8) & 15; }
public int clueC() { return (key >> 4) & 15; }
public int clueR() { return Grid.r((key >>> 4)); }
public int clueIndex() { return key >>> 4; }
public int clueC() { return Grid.c((key >>> 4)); }
public int dir() { return key & 15; }
public boolean horiz() { return horiz(key); }
public int pos(int i) { return offset(packedPos, i); }
@@ -416,7 +417,7 @@ public record SwedishGenerator(int[] buff) {
cc += nbrs16.dc;
}
if (n > 0) {
visitor.visit((r << 8) | (c << 4) | d, packedPos, n);
visitor.visit((idx << 4) | d, packedPos, n);
}
});
}
@@ -764,7 +765,8 @@ public record SwedishGenerator(int[] buff) {
if ((now - lastLog.get()) < logEveryMs) return;
lastLog.set(now);
var done = assigned.size();
var done = assigned.size();
// if (done!=grid.clueCount())throw new RuntimeException();
var pct = (TOTAL == 0) ? 100 : (int) Math.floor((done / (double) TOTAL) * 100);
var filled = Math.min(BAR_LEN, (int) Math.floor((pct / 100.0) * BAR_LEN));
var bar = "[" + "#".repeat(filled) + "-".repeat(BAR_LEN - filled) + "]";
@@ -854,9 +856,8 @@ public record SwedishGenerator(int[] buff) {
break;
}
}
if (!match) continue;
if (!placeWord(grid, s, w, ctx.undo, depth)) continue;
if (!match || !placeWord(grid, s, w, ctx.undo, depth)) continue;
used.set(w.index());
assigned.put(k, w);
@@ -892,9 +893,7 @@ public record SwedishGenerator(int[] buff) {
break;
}
}
if (!match) continue;
if (!placeWord(grid, s, w, ctx.undo, depth)) continue;
if (!match || !placeWord(grid, s, w, ctx.undo, depth)) continue;
used.set(w.index());
assigned.put(k, w);