code wiki / _hdl_build / nx_sudoku_html.nx
nx_sudoku_html.nx
buildroot/runtime/_hdl_build/nx_sudoku_html.nx
about
nx_sudoku_html.nx -- SOVEREIGN packager: the sudoku wasm module -> a self-contained playable page.
WHY NOT nx_wasm_html. That packager's shim is hardcoded for an f32 demo: it calls
render(yc,ys,xc,xs) with rotation matrices, never calls init() or tick(), and pins the canvas at a
fixed 512px with height:100vh -- so it cannot drive a turn-based game and cannot pass the estate's
reflow bar on a phone. A packager is part of the contract, not a detail: a game whose interface is
init/tick/render needs a shim that speaks it.
THE SOVEREIGN BOUNDARY, stated plainly. The emitted JS is a CANVAS SHIM and nothing else -- the
accepted foreign-browser last mile, the same position nx_wasm_html takes. It knows how to blit a
framebuffer and how to turn a keypress or a touch into an integer. It contains NO rules, NO solver,
NO generator, NO scoring and NO grid geometry: cell hit testing is an export (tap), so the page
cannot drift out of sync with the board it is drawing. Every decision is NishiLang.
RESPONSIVE BY CONSTRUCTION (WCAG 2.1 SC 1.4.10 Reflow @ 320px): the canvas carries no fixed pixel
width. It is width:100% inside a max-width container with aspect-ratio:1, and image-rendering
pixelated keeps the integer raster crisp when it scales. Taps are mapped back through the canvas
rect, so the module always receives framebuffer coordinates whatever size it is displayed at.
usage: nx_sudoku_html <in.wasm> <out.html>
exit : 0 ok | 2 usage | 3 cannot read wasm
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_base64.nxnx_wasmfit.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const K_MAGIC_8192: i64 = 8192 |
functions
| 28 | func hw(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 } |
| 30 | func main(argc: i64, argv: *i64) -> i64 |