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
41
S
16
G
6
Posts: 544
Reputation: 7,676

Post » Sat Mar 28, 2015 2:05 am

var % 2

Modulus
ImageImageImage
B
71
S
22
G
268
Posts: 3,809
Reputation: 148,249

Post » Sat Mar 28, 2015 2:33 am

Thanks :-D
B
41
S
16
G
6
Posts: 544
Reputation: 7,676


Return to Beginner's Questions

Who is online

Users browsing this forum: dop2000 and 0 guests