Written while builds are held (agents share 16 GB; no build or run until the user lifts it), so it has not been compiled or tested. The animals are rows of a ludic.base Table: x, z, species and alive as columns, a 32 m grid over the living, the living by species, and a nid map. wildlife_by_nid is a map lookup instead of a scan of every animal ever made, wildlife_count walks only its species, wildlife_nearest asks the grid, wildlife_set_alive writes the flag and the row together, and wildlife_refile files the tick's moves once after it (wildlife_verify holds the columns to the records). A guest puts its whole table away and brings it back. A test case covers them; to run once builds are allowed: ludic test packages/ludic.wildlife. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
676 B
Text
16 lines
676 B
Text
# guest.ludic - a machine that draws another's animals puts its own away whole, and they come back
|
|
# as they were when it stops; in between the list is the copies it is handed (wildlife_make)
|
|
|
|
export function wildlife_put_away(wildlife_st: mut WildlifeState) -> void {
|
|
if wildlife_st.wl_own != null { return }
|
|
wildlife_st.wl_own = wildlife_st.wl
|
|
wildlife_st.wl = wl__new()
|
|
}
|
|
|
|
export function wildlife_bring_back(wildlife_st: mut WildlifeState) -> void {
|
|
if wildlife_st.wl_own == null { return }
|
|
wildlife_st.wl = wildlife_st.wl_own
|
|
wildlife_st.wl_own = null
|
|
}
|
|
|
|
export function wildlife_away(wildlife_st: WildlifeState) -> bool { return wildlife_st.wl_own != null }
|