Rng.next_except.go: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/rng.bend as Rng Lines 95-105 of unified-nsga-iii@0.2.2.0/rng.bend: https://jend.leeeet.dev/read.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&start_line=95&end_line=105 import Base # C# NextExcept: uniform in [0, n) distinct from exclude when n > 1. def next_except.go(s: State, +exclude: Nat, n: Nat) -> State: match n: case 0n: with_k(s, 0n) case 1n: with_k(s, 0n) case 1n+m: +s2 = next_nat(s, m) +v = last_nat(s2) with_k(s2, bump_except(v, exclude, Nat.is_lt(v, exclude))) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=State https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=bump_except https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=last_nat https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=next_nat https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=with_k