21 lines
489 B
Plaintext
21 lines
489 B
Plaintext
|
|
||
|
sample = 6 4 rho 2 4 6 8 2 3 4 5 5 7 7 9 2 8 3 7 6 6 4 6 2 6 4 8
|
||
|
) get "input.ivy"
|
||
|
|
||
|
op r overlaps s = not (r[2] < s[1]) or (s[2] < r[1])
|
||
|
op r contains s = (r[1] <= s[1]) and (s[2] <= r[2])
|
||
|
|
||
|
op contains x = (x[1 2] contains x[3 4]) or (x[3 4] contains x[1 2])
|
||
|
op overlaps x = (x[1 2] overlaps x[3 4])
|
||
|
|
||
|
#1 3 overlaps 4 5
|
||
|
#1 5 overlaps 2 7
|
||
|
#contains 1 2 3 4
|
||
|
#contains 5 10 7 8
|
||
|
|
||
|
+/ contains transp sample
|
||
|
+/ contains transp input
|
||
|
|
||
|
+/ overlaps transp sample
|
||
|
+/ overlaps transp input
|