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
22
S
6
G
1
Posts: 403
Reputation: 3,394

Post » Sat Mar 28, 2015 2:05 am

var % 2

Modulus
ImageImageImage
B
70
S
19
G
142
Posts: 3,328
Reputation: 83,738

Post » Sat Mar 28, 2015 2:33 am

Thanks :-D
B
22
S
6
G
1
Posts: 403
Reputation: 3,394


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest