Code: [Select]Function isEven(num%) For i = -2147483648 To +2147483647 Step 2 If num = i Then Return True Next Return FalseEnd FunctionFunction isOdd(num%) For i = -2147483647 To +2147483647 Step 2 If num = i Then Return True Next Return FalseEnd Function

Function isEven(num%) For i = -2147483648 To +2147483647 Step 2 If num = i Then Return True Next Return FalseEnd FunctionFunction isOdd(num%) For i = -2147483647 To +2147483647 Step 2 If num = i Then Return True Next Return FalseEnd Function

Ohh no ... seems to contain a mistake.

That's my boy! true brute force at it's best ( even with a bug )

Function isEven(num%) If Instr("02468",Right(Str(num),1)) > 0 Then Return True Return FalseEnd FunctionFunction isOdd(num%) If Instr("13579",Right(Str(num),1)) > 0 Then Return True Return FalseEnd Function

method IsEven:bool( input:int ) local check:float = input / 2 return int(check) = checkend method

method IsEven:bool( input:int ) local check:float = input / 2.0 return int(check) = checkend method

method IsEven:bool( input:int ) return int(input / 2.0)*2 = inputend method

Function IsOdd:int(n:int) if n = 0 return 0 elseif n = 1 return 1 else return not IsOdd(n - 1) endifEnd Function