code wiki / _hdl_build / nx_user_sim_games.nx
nx_user_sim_games.nx
buildroot/runtime/_hdl_build/nx_user_sim_games.nx
about
nx_user_sim_games.nx -- CHAOS-USER simulator for the C-stage games
(operator: "playtesting isnt just api but actually mimics real users").
Drives nx_tictactoe and nx_checkers through the EXACT functions the
browser click-handlers call (nx_ttt_try_apply / nx_ttt_pick /
nx_chk_apply_*) -- the WASM export surface IS the UI's entry surface --
but in REAL-USER patterns, not happy-path API order:
* misclicks: occupied cells, out-of-range indices, double-clicks
* impatient clicking after the game has ended
* full seeded games to termination against the AI
Asserts the invariants a real player experiences: illegal input is a
visible no-op (state hash unchanged), games terminate, the perfect AI
never loses, a finished board ignores clicks.
This is the P0 guided-bot seed from the honesty roadmap. Honest scope:
covers the export surface; true DOM-event/pixel mimicry needs the SS22.5
sovereign browser-test-runner (PM plan). Catches the W/S-inversion CLASS
at the state layer: user input -> wrong state transition.
Exit: 0 all green (prints USER-SIM ALL-PASS); 1-6 = failing invariant.
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_tictactoe.nxnx_checkers.nxnx_prng.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_20260610: i64 = 20260610 |
functions
| 28 | func us_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 30 | func main() -> nx_int |