code wiki / _hdl_build / nx_coach_gamify.nx

nx_coach_gamify.nx

buildroot/runtime/_hdl_build/nx_coach_gamify.nx

4764 B76 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic coach
docsdependenciesstructsconstsfunctions

about

nx_coach_gamify.nx -- SKILL-COACH rung R4: GAMIFICATION (the operator's "gamified fun way"). Turns the coach grade-signal (R1 cents / R3 chord-accuracy) into XP / LEVEL / STREAK / MASTERY. JOY-FIRST BY CONSTRUCTION (feedback-games-as-test-avenues / joy-is-the-metric): points CLAMP >= 0 (a miss can NEVER subtract XP), a miss resets the streak to 0 (never negative, never a punishment), mastery = a PROVEN run (best_streak), NOT grind -- so loot-boxes / FOMO / loss-penalties are structurally impossible, not just "not added". Composes the coach verdict (coach_score_*). Render is nx_game_raster (visual = the next rung). Self-gate: a practice session + the JOY GUARD (a punitive negative-points attempt is refused). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_g_puts_lib.nx nx_coach_gamify.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_g_puts_lib.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write gam_new sys_mmap gam_record coach_score_sing g_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

12const LEVEL_XP: i64 = 500 // XP per level (data-driven; R2 rubric-store could hold it)
13const MASTERY_STREAK: i64 = 5 // consecutive clean = mastered the current skill

functions

19func g_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
22func coach_score_sing(verdict: i64, cents: i64) -> i64
called by 1: main
29func gam_new() -> *i64 { let s: *i64 = sys_mmap(8 * 8) as *i64; var i: i64 = 0; while i < 8 { s[i] = 0; i = i + 1 } return s }
called by 1: main calls 1: sys_mmap
30func gam_record(st: *i64, points: i64, is_clean: i64) -> i64
called by 1: main
45func main() -> i64