nx_actor_role_game_logic.nx
buildroot/runtime/nx_actor_role_game_logic.nx
about
nx_actor_role_game_logic.nx -- game-logic actor role.
Wraps [[nx_tictactoe]] (other-agent / sibling-arc game primitive) as
a cooperative actor. Each step plays ONE ply: the configured AI
picks a move for the current side, applies it, evaluates outcome,
fans out a GAME_ACTION message. Actor COMPLETED when game ends
(WIN / DRAW).
V1 ships tic-tac-toe; the same adapter shape will wrap nx_checkers
+ future game primitives in subsequent versions. Lighter transitive
import set than the image grader -- composes cleanly with the LLM +
audio adapters in a quad-companion smoke per
[[feedback-nxc2-module-const-ceiling]] guidance.
dependencies 6 imports · 3 importers
imports: nx_syscalls.nxnx_tier.nxnx_prng.nxnx_tictactoe.nxnx_actor.nxnx_message.nx
imported by: nx_actor_role_game_logic_test.nxnx_quad_companion_compose_test.nxnx_quad_real_emit_test.nx
structs
| 34 | struct NxGameLogicCtx |
consts
| 24 | const NX_GL_V_STEPPED: nx_int = 0 |
| 25 | const NX_GL_V_COMPLETED: nx_int = 1 |
| 26 | const NX_GL_V_FAILED_PICK: nx_int = 2 |
| 27 | const NX_GL_V_FAILED_APPLY: nx_int = 3 |
| 28 | const NX_GL_V_INVALID: nx_int = 4 |
| 29 | const NX_GL_V_NULL: nx_int = 5 |
| 30 | const NX_GL_V_N: nx_int = 6 |
| 46 | const NX_GL_CTX_BYTES: nx_int = 72 // 9 fields * 8 |
functions
| 50 | func nx_gl_v_is_valid(v: nx_int) -> nx_int called by 1: main |
| 56 | func nx_gl_difficulty_is_valid(d: nx_int) -> nx_int |
| 65 | func nx_gl_actor_new(first_mover: nx_int, |
| 91 | func nx_gl_actor_step(ctx: *NxGameLogicCtx, called by 3: mainmainmain calls 10: nx_ac_findnx_ac_completenx_ttt_turnnx_ttt_picknx_ttt_is_legalnx_ttt_try_apply+4 |
| 142 | func nx_gl_actor_outcome(ctx: *NxGameLogicCtx) -> nx_int |
| 147 | func nx_gl_actor_winner(ctx: *NxGameLogicCtx) -> nx_int |
| 152 | func nx_gl_actor_plies(ctx: *NxGameLogicCtx) -> nx_int |
| 157 | func nx_gl_actor_last_move(ctx: *NxGameLogicCtx) -> nx_int called by 1: main |
| 162 | func nx_gl_actor_last_side(ctx: *NxGameLogicCtx) -> nx_int |
| 167 | func nx_gl_actor_is_done(ctx: *NxGameLogicCtx) -> nx_int called by 1: main |