I just stumbled onto this:
In D7.02 'mod' works not only on integers but on lists of integers,
rects and points
foo = [1,2,3,4,5,6,7]
bar = [4,4,4,4,4,4,4]
put foo mod bar
-- [1, 2, 3, 0, 1, 2, 3]
a = point(23,48)
b = point(40,40)
put a mod b
-- point(23, 8)
I found this useful for wrapping a moving sprite's loc back onto the
other side of the stage:
<untested sample>
stageCorner = point(800,600)
newloc = spriteloc + locModifier
sprite(x).loc = newloc mod stageCorner
</untested sample>
If someone hits on a use for 'mod'ing rects, I'd be curious to see it.
but it doesn't work with rgb triads.
--
Carl West [EMAIL PROTECTED]
617.262.8830 x246
I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.
- Isabella, Measure for Measure, Act 3 Scene 1
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]