code wiki / (root) / nx_folkgame_play.nx

nx_folkgame_play.nx

buildroot/runtime/nx_folkgame_play.nx

11362 B289 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic folkgame
docsdependenciesstructsconstsfunctions

about

nx_folkgame_play.nx -- NATIVE terminal player for any align-family folk game. THE POINT OF THIS ORGAN IS THAT IT CAN BE PLAYED, and the operator's own standing correction is why it exists: an internal GREEN gate is not a thing anyone can open and play. Built by the Nishi toolchain (nx_cc -> nxasm_x86, no gcc) to a NATIVE binary that runs on this host -- no WebAssembly, no browser, no borrowed VM anywhere in the path. usage: nx_folkgame_play <slug> [depth] slug is a section of knowledge/compare/folkgames.align The opponent is full-width alpha-beta over the SAME move generator the gate validated against the published Tic-Tac-Toe game-tree constant. It is not a second rules implementation: if it could make a move the gate's generator does not admit, the two would disagree and this file would be the duplicate-ruler defect. Depth and evaluation weights are conf rows (knowledge/folkgames.conf), never literals. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_folkgame_lib.nx nx_folkgame_ai_lib.nx nx_lineconf_lib.nx nx_folkgame_play.nx

imports: nx_folkgame_lib.nxnx_folkgame_ai_lib.nxnx_lineconf_lib.nx

imported by: nobody (leaf or entry point)

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

main fgp_puts fgp_streq fg_parse_named_file sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ fg_read_spec sys_mmap ↻ ep_artifact_path sys_openat_rd sys_close ep_join fg_puts sys_write ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ fg_parse_named fg_parse_named_at fg_lineend fg_name_is fg_keyis fg_fieldoff

structs

none

consts

20const FGP_SPEC: *u8 = "knowledge/compare/folkgames.align"
21const FGP_CONF: *u8 = "knowledge/folkgames.conf"
22const FGP_LINECAP: i64 = 256
23const FGP_GRIDCAP: i64 = 4096
24const FGP_HUMAN: i64 = 1
25const FGP_AI: i64 = 2
26const FGP_SP: i64 = 32
27const FGP_DOT: i64 = 46
28const FGP_X: i64 = 88
29const FGP_O: i64 = 79

functions

31func fgp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
32func fgp_num(v: i64) -> i64
called by 2: fgp_render_idsmain
51func fgp_render(base: i64) -> i64
93func fgp_render_ids(base: i64) -> i64
called by 1: main calls 4: fgp_putsfg_cellsfg_xy_yfgp_num
115func fgp_readline(buf: *u8, cap: i64) -> i64
called by 1: main
135func fgp_ints(buf: *u8, n: i64, out: *i64) -> i64
called by 1: main
158func fgp_streq(a: *u8, b: *u8) -> i64
called by 1: main
168func main(argc: i64, argv: *i64) -> i64