code wiki / (root) / nx_tictactoe_test.nx

nx_tictactoe_test.nx

buildroot/runtime/nx_tictactoe_test.nx

7596 B173 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic tictactoe
docsdependenciesstructsconstsfunctions

about

nx_tictactoe_test.nx -- C0 substrate smoke. 12 deterministic assertions covering: 1. new game has X to move + outcome ongoing 2. 9 legal moves on a fresh board 3. apply X to cell 4 -> board[4]=X, turn=O, 8 legal moves left 4. illegal-move (occupied cell) is no-op 5. illegal-move (out-of-range) is no-op 6. horizontal-row win is detected (top row XXX) 7. diagonal win is detected (0-4-8 XXX) 8. draw is detected after 9 non-winning moves 9. state-hash is deterministic for same state 10. perfect-vs-perfect always ends in draw (game-theory invariant) 11. perfect-vs-random never loses (perfect's score never negative) 12. evaluate updates only the OUTCOME and WINNER cells (does not mutate board) Each failed assertion exits with a distinct non-zero code so the smoke harness identifies which check fired. Composes [[feedback-bug-class-prevention-additive-not-restrictive]] + ยง22 bug-class table entry "move-applies-to-wrong-cell" (the tic-tac-toe equivalent of the W/S inversion class).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_tictactoe.nx nx_prng.nx nx_tictactoe_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_tictactoe.nxnx_prng.nx

imported by: nobody (leaf or entry point)

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

main nx_ttt_new sys_mmap nx_ttt_turn nx_ttt_outcome nx_ttt_winner nx_ttt_legal_count nx_ttt_try_apply nx_ttt_is_legal nx_ttt_other nx_ttt_evaluate nx_ttt_cell nx_ttt_state_hash nx_ttt_pick_perfect nx_ttt_try_apply ↻ nx_ttt_minimax nx_ttt_try_apply ↻ nx_ttt_minimax ↻ nx_ttt_undo nx_ttt_undo ↻ nx_prng_init nx_ttt_pick_easy nx_ttt_legal_count ↻ nx_prng_range nx_prng_next nx_ttt_evaluate ↻

structs

none

consts

none

functions

29func main() -> nx_int