j132 strafe display check: also assert the chosen tile's heat number reaches the SVG with the heat grid ON and OFF
This commit is contained in:
@@ -68,6 +68,8 @@ proc main() =
|
|||||||
var m = initStrafe()
|
var m = initStrafe()
|
||||||
m.debugGraphics = false
|
m.debugGraphics = false
|
||||||
|
|
||||||
|
const DrawWindow = 400 ## ticks drawn: enough for ~30 picks, cheap to render
|
||||||
|
|
||||||
var
|
var
|
||||||
ticks = 0
|
ticks = 0
|
||||||
targetTicks = 0
|
targetTicks = 0
|
||||||
@@ -86,10 +88,33 @@ proc main() =
|
|||||||
bandComfy = 0 ## <= 2.5 (half of half)
|
bandComfy = 0 ## <= 2.5 (half of half)
|
||||||
bandLow = 0 ## 2.5 .. 5.0
|
bandLow = 0 ## 2.5 .. 5.0
|
||||||
bandMarginal = 0 ## 5.0 .. 10.0
|
bandMarginal = 0 ## 5.0 .. 10.0
|
||||||
|
svgTicks = 0 ## ticks whose overlay was rendered and inspected
|
||||||
|
svgBad = 0 ## the chosen tile's heat NUMBER is not in the SVG
|
||||||
|
svgNoPlate = 0 ## the chosen tile's dark value plate is not in the SVG
|
||||||
|
|
||||||
|
for tick, ws in states:
|
||||||
|
# The GUI half: render the overlay for the first `DrawWindow` ticks, with
|
||||||
|
# the heat grid ALTERNATING on/off so BOTH requirement-D arms are exercised
|
||||||
|
# (with the grid hidden the chosen tile's number must still be there).
|
||||||
|
# Drawing is read-only, so the pick sequence stays byte-identical; the SVG
|
||||||
|
# buffer is cleared every tick exactly as the framework does.
|
||||||
|
m.debugGraphics = tick < DrawWindow
|
||||||
|
if m.debugGraphics:
|
||||||
|
StrafeHeatGrid = (tick mod 2 == 0)
|
||||||
|
clearGraphics()
|
||||||
|
|
||||||
for ws in states:
|
|
||||||
discard m.computeMove(ws)
|
discard m.computeMove(ws)
|
||||||
inc ticks
|
inc ticks
|
||||||
|
|
||||||
|
if m.debugGraphics:
|
||||||
|
let svg = svgOutput()
|
||||||
|
clearGraphics()
|
||||||
|
if m.targetValid and svg.len > 0:
|
||||||
|
inc svgTicks
|
||||||
|
# The number printed ON the chosen tile, as the SVG sees it.
|
||||||
|
if not svg.contains(fmt">{m.targetPathHeat:.1f}</text>"): inc svgBad
|
||||||
|
if not svg.contains("fill=\"#000000\""): inc svgNoPlate
|
||||||
|
|
||||||
if not m.targetValid: continue
|
if not m.targetValid: continue
|
||||||
inc targetTicks
|
inc targetTicks
|
||||||
|
|
||||||
@@ -136,6 +161,10 @@ proc main() =
|
|||||||
fmt"({under} under / {over} over, {labelBad} bad)", labelBad == 0
|
fmt"({under} under / {over} over, {labelBad} bad)", labelBad == 0
|
||||||
check fmt"`strafeHeatText` carries the displayed number ({textBad} bad)",
|
check fmt"`strafeHeatText` carries the displayed number ({textBad} bad)",
|
||||||
textBad == 0
|
textBad == 0
|
||||||
|
check fmt"the chosen tile's heat NUMBER is rendered on the tile, grid ON " &
|
||||||
|
fmt"and OFF ({svgTicks} rendered ticks, {svgBad} missing)", svgBad == 0
|
||||||
|
check fmt"the chosen tile's value plate is rendered ({svgNoPlate} missing)",
|
||||||
|
svgNoPlate == 0
|
||||||
check "the stream contains picks to check", picks > 0
|
check "the stream contains picks to check", picks > 0
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -146,6 +175,7 @@ proc main() =
|
|||||||
fmt"max={maxH:.1f} best-alt known={altKnown}/{picks}"
|
fmt"max={maxH:.1f} best-alt known={altKnown}/{picks}"
|
||||||
echo fmt"buckets: <=2.5 {bandComfy} | 2.5-5 {bandLow} | 5-10 {bandMarginal} | " &
|
echo fmt"buckets: <=2.5 {bandComfy} | 2.5-5 {bandLow} | 5-10 {bandMarginal} | " &
|
||||||
fmt">10 (forced) {over}"
|
fmt">10 (forced) {over}"
|
||||||
|
echo fmt"overlay rendered on {svgTicks} ticks (heat grid alternating ON/OFF)"
|
||||||
echo fmt"sample log fields: [{strafeHeatText(7.3, 9.8)}] " &
|
echo fmt"sample log fields: [{strafeHeatText(7.3, 9.8)}] " &
|
||||||
fmt"[{strafeHeatText(11.4, -1.0)}]"
|
fmt"[{strafeHeatText(11.4, -1.0)}]"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user