code wiki / _hdl_build / nx_game_genetics_gate.nx
nx_game_genetics_gate.nx
buildroot/runtime/_hdl_build/nx_game_genetics_gate.nx
about
nx_game_genetics_gate.nx -- proves the genetics core teaches REAL science by MEASURING the textbook
ratios out of the running simulation. Nothing here is asserted: every tooth crosses thousands of
virtual creatures and checks the emergent numbers against what Mendel/Morgan/waddington predict.
If a tooth is green, a student could reproduce that number with a pencil and a Punnett square.
MUTATION TARGET (documented): break segregation in gx_gamete (always pass allele 0) => T1 monohybrid
ratio collapses to 4:0 => RED, while the independent-assortment and epigenetic teeth are unaffected.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_game_genetics.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
| 43 | const N: i64 = 8000 // sample size: big enough that a 3:1 lands inside +/-40 permil |
| 44 | const TOL: i64 = 45 // permil tolerance on every predicted ratio |
functions
| 12 | func gg_cat(b: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { b[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: main |
| 13 | func gg_catn(b: *u8, off: i64, v: i64) -> i64 |
| 26 | func p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 27 | func pn(v: i64) -> i64 |
| 41 | func nl() -> i64 { p("\n" as *u8); return 0 } |
| 46 | func near(got: i64, want: i64) -> i64 called by 1: main |
| 53 | func main() -> i64 |