Range consolidation: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: removed an unnecessary deep_copy(), inlined the rs>re test) |
|||
Line 710:
{{trans|C#}}
<lang dyalect>type Pt(s, e) with Lookup
func Pt.Min() => min(this.s, this.e)
Line 725:
func overlap(left, right) =>
left.Max() > right.Max() ? right.Max() >= left.Min()
func consolidate(left, right) => Pt(min(left.Min(), right.Min()), max(left.Max(), right.Max()))
|