wierd pattern
i am trying to write a function that will return true when the number input is between 1 and 13 inclusive; and false if between 14 and 28 inclusive; then true again if between 29 and 41 ... and so on and so on. So it flips every 13 numbers.
I think there is probably a mathmatical formula for this pattern.
any help please???
take the (number - 1) % 28
This will always be in the range 0-27
0-12 is true, 13-27 is false
This will always be in the range 0-27
0-12 is true, 13-27 is false
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement