LAWS.custom: def of minebender-game@1.0.0.0 Import: import minebender-game@1.0.0.0/LAWS.bend as LAWS Lines 517-522 of minebender-game@1.0.0.0/LAWS.bend: https://jend.leeeet.dev/read.txt?path=minebender-game@1.0.0.0/LAWS.bend&start_line=517&end_line=522 import Base import minebender-game@1.0.0.0/types.bend as T # Windows XP's Custom Field dialog: width is clamped to 9..30, height to # 9..25 and mines to 10..999, then mines are capped at width*height - 10. def custom(w: Nat, h: Nat, m: Nat) -> T.Setup: +cw = clamp(9n, 30n, w) +ch = clamp(9n, 25n, h) T.Setup{cw, ch, Nat.min(clamp(10n, 999n, m), Nat.sub(Nat.mul(cw, ch), 10n))} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.min https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/LAWS.bend&name=clamp https://jend.leeeet.dev/definition.txt?path=minebender-game@1.0.0.0/types.bend&name=Setup