code wiki / (root) / nx_folkgame_align_gate.nx

nx_folkgame_align_gate.nx

buildroot/runtime/nx_folkgame_align_gate.nx

11011 B234 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic folkgame
docsdependenciesstructsconstsfunctions

about

nx_folkgame_align_gate.nx -- GATE for the align family of nx_folkgame_lib. THE LOAD-BEARING TOOTH IS T5. The number of possible games of Tic-Tac-Toe -- counting every distinct sequence of moves and stopping each line the moment somebody wins -- is 255,168. That is a PUBLISHED COMBINATORIAL CONSTANT, not a number this estate computed and then asserted about itself. A move generator that is wrong anywhere (one illegal move admitted, one legal move missed, a win not detected, a draw detected early) cannot land on it by accident. Every other tooth here checks a shape; T5 checks the RULES. The neg-controls are equally deliberate: three malformed specs that MUST be refused, because a parser that accepts everything passes every positive test ever written against it. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_folkgame_lib.nx nx_folkgame_ai_lib.nx nx_lineconf_lib.nx nx_gate_verdict.nx nx_folkgame_align_gate.nx

imports: nx_folkgame_lib.nxnx_folkgame_ai_lib.nxnx_lineconf_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ fg_parse_named_file sys_mmap ↻ 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

structs

none

consts

20const FGA_TTT_GAMES: i64 = 255168
21const FGA_TTT_CELLS: i64 = 9
22const FGA_TTT_LINES: i64 = 8
23const FGA_NMM_CELLS: i64 = 24
24const FGA_NMM_LINES: i64 = 16
25const FGA_MOR_LINES: i64 = 20
26const FGA_GOM_LINES: i64 = 572
27const FGA_ACHI_PLACEMENTS: i64 = 8
28const FGA_DARA_CELLS: i64 = 30
29const FGA_DARA_W: i64 = 6
30const FGA_DARA_H: i64 = 5
31const FGA_DARA_L: i64 = 3
33const FGA_DARA_LINES: i64 = 38
36const FGA_DARA_LINES_DIAG: i64 = 62
37const FGA_SPEC: *u8 = "knowledge/compare/folkgames.align"
38const FGA_CONF: *u8 = "knowledge/folkgames.conf"

functions

40func fga_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
44func fga_games(base: i64, snap: *i64, sw: i64, mvb: *i64, mm: i64, scratch: *i64, d: i64) -> i64
62func fga_open_moves(base: i64) -> i64
called by 1: main calls 2: fg_maxmovesfg_moves
70func main() -> i64