Split The code is public; the app answers only to the crew.
Is a gun on the floor worth walking to? The arithmetic in `plan.ts`, tested without a world #222
Check · Review · Land · Live done — Landed and live in production.
Pushed.
shipped merged
Sign in to join this conversation.
Pushed.
Added
worthTheDetour(toGun, gunToGoal, toGoal)andGUN_DETOUR_MAXtosrc/client/plan.ts, besidemustPush/mustHunt: pure arithmetic on world-unit distances, no import ofWorldorPickup. The detour cost is(toGun + gunToGoal - toGoal) / WALK_SPEED, compared againstGUN_DETOUR_MAX = 2seconds of walking — long enough to step off the direct line for a gun in a doorway on the way, short enough that one across the site or map isn't worth it. Non-finite or negative distances returnfalserather than throwing or propagating NaN.Tests in
plan.test.tscover: a gun straight on the way (worth it), one a stride (65 units) off the path (worth it), one clear across the map (not worth it), the bound checked from both sides, and every non-finite/negative input across all three arguments.Left out, as scoped: nothing imports
worthTheDetouryet —bots.tsis untouched, no measurement or README claim is owed here.bun run check(tsc +bun test) is green, no new dependency.Closes #215