flatland: add 'within?'
parent
9ad51490af
commit
195acdd600
|
@ -2,6 +2,7 @@
|
||||||
USING: accessors arrays fry kernel math math.vectors sequences
|
USING: accessors arrays fry kernel math math.vectors sequences
|
||||||
math.intervals
|
math.intervals
|
||||||
multi-methods
|
multi-methods
|
||||||
|
combinators.short-circuit
|
||||||
combinators.cleave.enhanced
|
combinators.cleave.enhanced
|
||||||
multi-method-syntax ;
|
multi-method-syntax ;
|
||||||
|
|
||||||
|
@ -218,3 +219,16 @@ USING: locals combinators ;
|
||||||
cond
|
cond
|
||||||
|
|
||||||
2array ;
|
2array ;
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
GENERIC: within? ( a b -- ? )
|
||||||
|
|
||||||
|
METHOD: within? ( <pos> <rectangle> -- ? )
|
||||||
|
{
|
||||||
|
[ left to-the-right-of? ]
|
||||||
|
[ right to-the-left-of? ]
|
||||||
|
[ bottom above? ]
|
||||||
|
[ top below? ]
|
||||||
|
}
|
||||||
|
2&& ;
|
||||||
|
|
Loading…
Reference in New Issue