code wiki / _hdl_build / nx_tactics_engine_gate.nx

nx_tactics_engine_gate.nx

buildroot/runtime/_hdl_build/nx_tactics_engine_gate.nx

7698 B196 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic tactics
docsdependenciesstructsconstsfunctions

about

nx_tactics_engine_gate.nx -- gate for the data-driven TACTICS SIMULATION engine (G-ECO-005 rung 1). Drives the REAL nx_tactics_engine_lib headlessly (no terminal) and asserts the engine is genuinely CONFIG-DRIVEN + the core mechanics work, by RUNNING (not asserting): (1) DATA-DRIVEN: two distinct configs yield distinct rosters (2v2 vs 2v3, 4 vs 5 units). (2) WIN/LOSE both reachable: clearing team1 -> mode=win; clearing team0 -> mode=lose. (3) COVER matters: hit-chance on open cell > hit-chance on a cover cell (same distance). (4) BOUNDS: out-of-grid reads = wall; a move into a wall is rejected (no move, no move spent). (5) EMERGENT PLAYTHROUGH: a scripted bot (advance-to-range + shoot) drives a full 2v2 battle to a RESOLUTION (win or lose) within a bounded turn budget -- the whole turn loop + AI run end-to-end. TACTICS-ENGINE-GATE verdict=GREEN iff all hold -> knowledge/status/tactics_engine.log. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tactics_engine_lib.nx nx_tactics_engine_gate.nx

imports: nx_syscalls.nxnx_tactics_engine_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap teng_init teng_build teng_cell_set teng_rng teng_cell_get teng_nunits teng_place_unit teng_rng ↻ teng_cell_get ↻ teng_unit_at teng_nunits ↻ teng_first_player teng_nunits ↻ teng_team_alive teng_nunits ↻ teng_nunits ↻ teng_check_end teng_team_alive ↻ teng_chance teng_cell_get ↻ teng_move_unit teng_cell_get ↻ teng_unit_at ↻ tbot teng_nearest_foe teng_nunits ↻ teng_dist teng_abs teng_check_end ↻ teng_dist ↻ teng_input teng_move_unit ↻ teng_shoot teng_nearest_foe ↻ teng_dist ↻ teng_cell_get ↻ teng_chance ↻ teng_rng ↻

structs

none

consts

none

functions

15func tg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: tg_report calls 1: sys_write
16func tg_n(fd: i64, v: i64) -> i64
called by 1: tg_report calls 2: sys_writesys_mmap
27func tg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: tg_has
28func tg_has(buf: *u8, len: i64, pat: *u8) -> i64
called by 1: main calls 1: tg_len
39func tg_count_nl(buf: *u8, len: i64) -> i64
called by 1: main
47func tbot(st: *i64, cap: i64, itout: *i64) -> i64
82func tg_report(fd: i64, r: *i64, ok: i64) -> i64
called by 1: main calls 2: tg_wtg_n
106func main() -> i64