Advertisement

wierd pattern

Started by June 25, 2003 12:45 AM
2 comments, last by jakerrz 21 years, 7 months ago
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
Advertisement
thanks!!
Or you could fit a sine wave to your pattern, then check whether it is negative or not, but that would be harder and more useless.
You know what I never noticed before?

This topic is closed to new replies.

Advertisement