Question
Detecting even and odd numbers
Hi, I'm drawing a series of rectangles using AS3, and need
every alternate one to be lighter... I'm using a switch statement
currently, with a variable counting the number of rectangles and
case 1, case 2, case 3, etc.
Is there a formula or some way of telling whether there is an even or odd number of rectangles so my switch statement can just be case even:, case odd: ? The way I have it is fine for 10 or so rectangles but I'd rather make it more expandable.
Would appreciate any suggestions
Is there a formula or some way of telling whether there is an even or odd number of rectangles so my switch statement can just be case even:, case odd: ? The way I have it is fine for 10 or so rectangles but I'd rather make it more expandable.
Would appreciate any suggestions
