# Find if x is in [a,b] # if strict is true then it can't be a or b # def inrange(a, x, b, strict=false) t = (a < x || (!strict && a == x)) && (x < b || (!strict && b == x)) t end