code wiki / _hdl_build / nx_coach_gamify.nx
nx_coach_gamify.nx
buildroot/runtime/_hdl_build/nx_coach_gamify.nx
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
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
structs
| none |
consts
| 12 | const LEVEL_XP: i64 = 500 // XP per level (data-driven; R2 rubric-store could hold it) |
| 13 | const MASTERY_STREAK: i64 = 5 // consecutive clean = mastered the current skill |
functions
| 19 | func g_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 22 | func coach_score_sing(verdict: i64, cents: i64) -> i64 called by 1: main |
| 29 | func 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 } |
| 30 | func gam_record(st: *i64, points: i64, is_clean: i64) -> i64 called by 1: main |
| 45 | func main() -> i64 |