def whole.pick
import cswap-bend-cli@0.1.0.0/render.bend as Renderimport Base
import cswap-bend-cli@0.1.0.0/clock.bend as Clock
33# `{pct:>3.0f}`: tenths rounded to a whole percent, halves to even, width 3.
34def whole.pick(+w0: U32, +r: U32) -> U32:
35 Clock.sel(U32.is_gt(r, 5), (w0 + 1 : U32), Clock.sel(U32.is_eq(r, 5), (w0 + (w0 % 2) : U32), w0))