this post was submitted on 09 May 2025
249 points (98.8% liked)
Programmer Humor
39041 readers
242 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Isn't the logic inverted? I think you want a == 0 on each of those conditions
You wouldn't even need the first if you removed the space
Correct, noticed the same thing. Should have been a bang in front of each of the terms, your modulus of any of those will return a
0when hit, which will convert tofalseand fail each of those conditions.This solution will do the opposite of what was intended unless the
ifconditions are inverted. Then it works flawlessly and the%15is indeed a clever solution.