nx_tictactoe_test.nx
buildroot/runtime/nx_tictactoe_test.nx
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
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
structs
| none |
consts
| none |
functions
| 29 | func main() -> nx_int |