I feel like there's an easy answer to this problem but for some reason it's alluding me.
Here's the problem:
if number x is an even number, then do this thing.
if number x is an odd number (or not an even number), don't do that thing.
simple boolean question. My problem is that I can't think of a way to represent even and odds as a property in processing. So I tried to define even and odd numbers:
Even numbers are numbers that when divided by 2 yield a whole number.
Odd numbers are numbers that when divided by 2 yield fractional numbers.
int x;
float x;
boolean a = false;
/*I know you can't do this but...I'm trying, essentially, to ask is x an integer (whole number) or float (fractional number). I was thinking about trying to use %, but I'm scared of it:
float || int r = random (100); ?? */
if ( r / 2 = int){
stroke (255);
} else {
noStroke;
}
}
Does that^ make any sense at all? Can anyone help me figure out the whole odd/even thing?