code wiki / _hdl_build / nx_garden.nx

nx_garden.nx

buildroot/runtime/_hdl_build/nx_garden.nx

12417 B206 linesdepth 4pulls 5 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_food_science.nx nx_seg_store.nx nx_syscalls.nx nx_garden.nx nx_companion_gate.nx nx_garden_gate.nx nx_household.nx nx_household_gate.nx nx_perma_mine.nx

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

13func gd_money(dst: *u8, off: i64, cents: i64) -> i64
called by 1: gd_render_plan calls 1: fd_apnum
23func gd_crop_key(id: *u8, out: *u8) -> i64
called by 1: gd_get calls 1: as_append
30func gd_get(prefix: *u8, id: *u8, ptr: *i64, len: *i64) -> i64
35func gd_growable(prefix: *u8, id: *u8) -> i64
41func gd_field_int(prefix: *u8, id: *u8, f: i64) -> i64
49func gd_field_str(prefix: *u8, id: *u8, f: i64, out: *u8) -> i64
55func gd_buy(prefix: *u8, id: *u8) -> i64 { return gd_field_int(prefix, id, 2) }
56func gd_grow(prefix: *u8, id: *u8) -> i64 { return gd_field_int(prefix, id, 3) }
58func gd_savings(prefix: *u8, id: *u8) -> i64
69func gd_companion(prefix: *u8, a: *u8, b: *u8) -> i64
82func gd_seed_companions(prefix: *u8) -> i64
105func gd_companion_bonus(prefix: *u8, world: *i64, idxs: *i64, nidx: i64) -> i64
called by 1: main calls 1: gd_companion
122func gd_seed(prefix: *u8) -> i64
159func gd_meal_savings(prefix: *u8, food_world: *i64, build: *i64, nb: i64, out_grow: *i64) -> i64
174func gd_render_plan(prefix: *u8, food_world: *i64, build: *i64, nb: i64, meals_per_week: i64, out: *u8) -> i64