odd and even numbers
J. Landman Gay
jacque at hyperactivesw.com
Mon Aug 5 16:34:10 EDT 2013
On 8/5/13 3:25 PM, Mike Kerner wrote:
> Craig is such a party pooper. There have got to be ways that are more fun
> and demonstrate the breadth of the language to new users
>
> if x/2 contains "." then answer "odd" else answer "even"
> if x/2 = x div 2 then answer "even" else answer "odd"
>
> hmmmmm what else?
if last char of x is among the items of "0,2,4,6,8" then answer "even"
else answer "odd"
But personally I always use "mod" even though I don't go to parties.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list