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
34
S
15
G
6
Posts: 509
Reputation: 7,326

Post » Sat Mar 28, 2015 2:05 am

var % 2

Modulus
ImageImageImage
B
71
S
21
G
204
Posts: 3,586
Reputation: 115,576

Post » Sat Mar 28, 2015 2:33 am

Thanks :-D
B
34
S
15
G
6
Posts: 509
Reputation: 7,326


Return to Beginner's Questions

Who is online

Users browsing this forum: Matheus Moura, the_Shit_hawk and 0 guests