nx_math_games.nx
buildroot/runtime/nx_math_games.nx
about
nx_math_games.nx -- entry-level math games + puzzles + riddles for
the pedagogy bridge (kindergarten -> advanced).
Per comprehensive-proofs + bits-up-pedagogy cardinal 2026-05-14:
substrate must bridge entry-level beginner -> advanced math via
games, riddles, fun puzzles. All primitives substrate-native; no
Python / JavaScript / external dependencies.
Per "no null-where-null-shouldnt-be" cardinal 2026-05-14:
functions that can fail return *NxResult rather than -1 sentinels.
Callers MUST check nx_result_is_ok before unwrapping.
dependencies 6 imports · 1 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_classical_unpatented.nxnx_classical_unpatented_2.nxnx_result.nx
imported by: nx_math_games_test.nx
structs
| none |
consts
| 28 | const NX_GAME_GUESS_LOW: nx_int = -1 |
| 29 | const NX_GAME_GUESS_HIGH: nx_int = 1 |
| 30 | const NX_GAME_GUESS_CORRECT: nx_int = 0 |
| 39 | const NX_GAME_PARITY_EVEN: nx_int = 0 |
| 40 | const NX_GAME_PARITY_ODD: nx_int = 1 |
| 61 | const NX_GAME_PATTERN_ARITH: nx_int = 1 |
| 62 | const NX_GAME_PATTERN_GEOM: nx_int = 2 |
| 63 | const NX_GAME_PATTERN_NONE: nx_int = 0 |
functions
| 32 | func nx_game_guess_check(secret: nx_int, guess: nx_int) -> nx_int called by 1: main |
| 42 | func nx_game_parity(n: nx_int) -> nx_int called by 1: main |
| 50 | func nx_game_find_factor(n: nx_int) -> *NxResult |
| 65 | func nx_game_pattern_kind(a: nx_int, b: nx_int, c: nx_int) -> nx_int called by 1: nx_game_pattern_next |
| 74 | func nx_game_pattern_next(a: nx_int, b: nx_int, c: nx_int) -> *NxResult |
| 85 | func nx_riddle_pigeonhole(n_pigeons: nx_int, n_holes: nx_int) -> *NxResult |
| 92 | func nx_riddle_triangle_n(n: nx_int) -> *NxResult |
| 98 | func nx_riddle_hanoi_moves(n: nx_int) -> *NxResult |
| 107 | func nx_riddle_coin_flip_outcomes(n: nx_int) -> *NxResult |
| 117 | func nx_puzzle_caesar_decrypt(c: nx_int, k: nx_int) -> nx_int called by 1: main |
| 128 | func nx_puzzle_magic_3x3_check(a: nx_int, b: nx_int, c: nx_int) -> nx_int called by 1: main |
| 134 | func nx_puzzle_fib(n: nx_int) -> nx_int |