3 ms·
> Instead of showing rules as a linear list, I'd suggest it's easier to visualise it as a tree, or simpler still, as a series of nested ifs. Feel free to post
by throw0101c 3y ago
> Instead of showing rules as a linear list, I'd suggest it's easier to visualise it as a tree, or simpler still, as a series of nested ifs.
Feel free to post a comment with ASCII art or (pseudo-)code. :)
- PopAlongKid 3y ago(gets 1978 copy of The C Programming Language off the shelf) if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) [it's a leap year] else [it's not] I remember this because it is where I first learned the extra rules, beyond just every 4th year.