moverules: blocked policy set/keep/clear (GM moves and placements set/clear, KEEP while any wall overlaps); tests; mutations k, l
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
# d1/d2: drop arm 1/2 of the shared-vertex fixture
|
||||
# e: cellsTouched without the fill spans | f: escape rule without the crossing check | g: GM moves checked against walls
|
||||
# h: capsule reduced to centre path + destination circle (prototype H10) | i: no step cap | j: blocked trigger needs centre-on-wall
|
||||
# k: wall removal / door open clears blocked unconditionally (no KEEP) | l: GM moves never set/clear blocked
|
||||
# Log: results/mutation.log
|
||||
cd "$(dirname "$0")/.." || exit 1
|
||||
mkdir -p results
|
||||
@@ -19,6 +20,8 @@ G="GM: ignores walls, step cap and blocked"
|
||||
H="corner clipping|leg of the path|diagonal squeeze past"
|
||||
I="step cap|over-cap, blocked-by-wall|P1:|P2:"
|
||||
J="wall added within r of the circle|Q14: a door closed"
|
||||
K="KEEP:|GM manual clear inside|Q14: a door closed"
|
||||
L="GM moves a stuck token|GM drops a token|GM manual clear inside|GM: ignores walls"
|
||||
rc=0
|
||||
: > "$LOG"
|
||||
run() { # $1 id $2 title $3 file to mutate $4 sed script ("" = control) $5 expected-failure regex
|
||||
@@ -58,5 +61,7 @@ run g "GM moves checked against walls" server/moverules.nim 's/^ if not inBou
|
||||
run h "capsule = centre path + destination circle (prototype)" server/moverules.nim 's/elif segsCross(s, d, w.a, w.b) or segSegDist(s, d, w.a, w.b) < r: return false/elif segsCross(s, d, w.a, w.b) or segDist(d, w.a, w.b) < r: return false/' "$H"
|
||||
run i "no step cap" server/moverules.nim '/if hypot(dd.x, dd.y) > stepCap(sc, sc.tokens\[ti\]): return nack(s)/d' "$I"
|
||||
run j "blocked trigger needs the centre on the wall" server/moverules.nim 's/segDist(t.pos, w.a, w.b) < sc.tokenRadius/segDist(t.pos, w.a, w.b) < 1e-9/' "$J"
|
||||
run k "removal/open clears blocked unconditionally (no KEEP)" server/moverules.nim 's/sc.tokens\[i\].blocked = overlapsAny(sc, sc.tokens\[i\])/sc.tokens[i].blocked = false/' "$K"
|
||||
run l "GM moves never set or clear blocked" server/moverules.nim '/^ if who.role == roleGM: sc.tokens\[ti\].blocked = /d' "$L"
|
||||
echo "exit=$rc" | tee -a "$LOG"
|
||||
exit $rc
|
||||
|
||||
Reference in New Issue
Block a user