Game.gen.pick: def of minebender-game@1.0.0.0 Import: import minebender-game@1.0.0.0/game.bend as Game Lines 141-148 of minebender-game@1.0.0.0/game.bend: https://jend.leeeet.dev/read.txt?path=minebender-game@1.0.0.0/game.bend&start_line=141&end_line=148 import Base # Whether the next candidate gets a mine: forced when every candidate left # needs one, else a coin flip that comes up heads about need/left of the time. def gen.pick(+need: Nat, +left: Nat, rs: List<&2, U32>) -> Bool: match rs: case Nil{}: Nat.is_eq(need, left) case r <> t: Nat.is_eq(need, left) || gen.coin(r, left, need) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/game.bend&name=gen.coin