Cover.tree.uniform: def of gralha-coverage@0.1.0.1 Import: import gralha-coverage@0.1.0.1/cover.bend as Cover Lines 100-109 of gralha-coverage@0.1.0.1/cover.bend: https://jend.leeeet.dev/read.txt?path=gralha-coverage@0.1.0.1/cover.bend&start_line=100&end_line=109 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def tree.uniform(t: CovTree, +nx: U32, +ny: U32, +size: U32, +x0: U32, +y0: U32, +x1: U32, +y1: U32, +acc: F32) -> F32: match t: case CovFlat{v}: U.choose(F32, tree.overlaps(nx, ny, size, x0, y0, x1, y1), tree.same.as(acc, v), acc) case CovQuad{a, b, c, d}: +half = U32.div(size, 2) U.branch(F32, Bool.not(tree.overlaps(nx, ny, size, x0, y0, x1, y1)) || F32.is_lt(acc, F32.neg(0.5)), _ => acc, _ => tree.uniform(d, (nx + half : U32), (ny + half : U32), half, x0, y0, x1, y1, tree.uniform(c, nx, (ny + half : U32), half, x0, y0, x1, y1, tree.uniform(b, (nx + half : U32), ny, half, x0, y0, x1, y1, tree.uniform(a, nx, ny, half, x0, y0, x1, y1, acc))))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=CovTree https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=tree.overlaps https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=tree.same.as https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose