odd number and even numbers

Mark Schonewille m.schonewille at economy-x-talk.com
Mon Aug 17 15:43:46 EDT 2009


Hi William,

Here's one of many possibilities:

function even theNr
   return (trunc(theNr/2)*2 is theNr)
end even

function odd theNr
   return not even(theNr)
end odd

Actually, believe mine is a bit clumsy, but ut works.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com

Download Snapper Screen Recorder at http://snapper.economy-x-talk.com

On 17 aug 2009, at 21:37, william humphrey wrote:

> Don't kick me but what is the simple way to tell in a repeat function
> x = 1 to total number
> put x and x + 1
> when x is even do this
> or when x is odd do this
>
>
> ??
>
> I started using mod and all kinds of weird math and I know there  
> must be a
> simple way.





More information about the use-livecode mailing list