How can I tell if a number is odd or even with events/code?

Just started using Construct 2? Post your questions here

Post » Sat Mar 28, 2015 1:15 am

Like the title says. I'd like to be able to get a condition to trigger if variable X is an odd number. I seem to remember that there's a way, like if you have the number 73 and do some math magic stuff you get 1 returned while if it's 74 you get zero. I can't remember how though and I don't have the brainpower to figure it out by myself. Any help much appreciated :)
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Sat Mar 28, 2015 2:05 am

var % 2

Modulus
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Sat Mar 28, 2015 2:33 am

Thanks :-D
B
38
S
16
G
6
Posts: 537
Reputation: 7,582


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests