code wiki / _hdl_build / nx_garden.nx
nx_garden.nx
buildroot/runtime/_hdl_build/nx_garden.nx
about
nx_garden.nx -- LIB: the GROW-YOUR-OWN affordability engine (operator: "garden-to-table ... affordability
improvement"). For each food ingredient, models whether you can grow it at home, the season, and the cost to
BUY vs the cost to GROW (cents, integer -- no float). The savings = buy - grow is the affordability win:
grow-your-own turns a Michelin ingredient into a budget one. Each crop CITES a real permaculture research
source (knowledge/fetched/perma_*.raw) -- research, not bro science. Crops live in the food store keyed
garden:crop:<food-ingredient-id>. Only growable ingredients have a record (proteins/processed sauces don't).
Schema: garden:crop:<id> -> difficulty(1-5) <t> season <t> buy_cents <t> grow_cents <t> yield <t> cite
license_tier: ORIGINAL
dependencies 3 imports · 5 importers
imports: nx_food_science.nxnx_seg_store.nxnx_syscalls.nx
imported by: nx_companion_gate.nxnx_garden_gate.nxnx_household.nxnx_household_gate.nxnx_perma_mine.nx
structs
| none |
consts
| none |
functions
| 13 | func gd_money(dst: *u8, off: i64, cents: i64) -> i64 |
| 23 | func gd_crop_key(id: *u8, out: *u8) -> i64 |
| 30 | func gd_get(prefix: *u8, id: *u8, ptr: *i64, len: *i64) -> i64 |
| 35 | func gd_growable(prefix: *u8, id: *u8) -> i64 called by 7: maingd_savingsgd_meal_savingsgd_render_planmainpm_promote_companions+1 calls 2: sys_mmapgd_get |
| 41 | func gd_field_int(prefix: *u8, id: *u8, f: i64) -> i64 |
| 49 | func gd_field_str(prefix: *u8, id: *u8, f: i64, out: *u8) -> i64 |
| 55 | func gd_buy(prefix: *u8, id: *u8) -> i64 { return gd_field_int(prefix, id, 2) } |
| 56 | func gd_grow(prefix: *u8, id: *u8) -> i64 { return gd_field_int(prefix, id, 3) } |
| 58 | func gd_savings(prefix: *u8, id: *u8) -> i64 |
| 69 | func gd_companion(prefix: *u8, a: *u8, b: *u8) -> i64 |
| 82 | func gd_seed_companions(prefix: *u8) -> i64 |
| 105 | func gd_companion_bonus(prefix: *u8, world: *i64, idxs: *i64, nidx: i64) -> i64 |
| 122 | func gd_seed(prefix: *u8) -> i64 |
| 159 | func gd_meal_savings(prefix: *u8, food_world: *i64, build: *i64, nb: i64, out_grow: *i64) -> i64 |
| 174 | func gd_render_plan(prefix: *u8, food_world: *i64, build: *i64, nb: i64, meals_per_week: i64, out: *u8) -> i64 called by 1: main calls 11: as_appendsys_mmapgd_meal_savingsgd_growableas_append_escapedgd_field_str+5 |