code wiki / (root) / nx_games_js.nx

nx_games_js.nx

buildroot/runtime/nx_games_js.nx

10193 B123 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic games
docsdependenciesstructsconstsfunctions

about

nx_games_js.nx -- LIB (no main): the /games portal's shared emit helpers plus the whole client script block. Split out of nx_games_page.nx 2026-08-10. WHY THE SPLIT. Two reasons, in order of merit: 1. SINGLE RESPONSIBILITY (rule 9). The page organ authors document structure, tokens and copy; this organ authors game behaviour. One file was doing both and had grown past 31 KB. 2. It also happens to fix a transport ceiling: the estate's nx_fs_write lane could not carry a 31 KB payload (eight verified attempts, artifact unchanged every time), while both halves of the split carry first try. That is a side benefit, NOT the justification -- a split made only to dodge a transport limit would be a hack; this one is the decomposition the file was owed. SUDOKU IS NO LONGER HERE (2026-08-10). It became a sovereign NishiLang module compiled to WebAssembly (nx_sudoku_wasm) and served at /games/sudoku, where the page holds no game logic at all. Its JS, its bank parser and the GJS_ROW record constant went with it: keeping a second implementation of the same ruleset in JavaScript would have been the duplicate-ruler defect. Connect Four and Tic-Tac-Toe are still JS here and are owed the same treatment. license_tier: ORIGINAL genealogy_id: nishi_games_portal lineage_id: nx_games_js_v2

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_games_js.nx nx_games_page.nx

imports: nx_syscalls.nx

imported by: nx_games_page.nx

structs

none

consts

none

functions

24func gm_cat(dst: *u8, off: i64, s: *u8) -> i64
32func gm_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
49func gm_card(dst: *u8, off: i64, name: *u8, note: *u8, href: *u8, state: i64) -> i64
calls 1: gm_cat
66func gjs_scripts(h: *u8, w0: i64) -> i64
calls 1: gm_cat