32
1
Introduction
Some months are completely symmetric, meaning they have central symmetry as well as reflection symmetry, like February of 2010
:
February 2010
┌──┬──┬──┬──┬──┬──┬──┐
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
└──┴──┴──┴──┴──┴──┴──┘
Some months have only central symmetry, like February of 1996
or current month, the April of 2018
:
February 1996
┌──┬──┬──┬──┐
│ │ │ │ │
┌──┬──┬──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┴──┴──┘
│ │ │ │ │
└──┴──┴──┴──┘
April 2018 ┌──┐
│ │
┌──┬──┬──┬──┬──┬──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┴──┴──┴──┴──┴──┘
│ │
└──┘
And some are asymmetric, like the previous month, the March of 2018
:
March 2018
┌──┬──┬──┬──┐
│ │ │ │ │
┌──┬──┬──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┤
│ │ │ │ │ │ │ │
├──┼──┼──┼──┼──┼──┼──┘
│ │ │ │ │ │ │
└──┴──┴──┴──┴──┴──┘
Task
Take an input in form of a date, e.g.:
2018.04
2018.03
2010.02
1996.02
Output the corresponding symmetry, e.g.
2018.04
->centrally symmetric
2018.03
->asymmetric
2010.02
->symmetric
1996.02
->centrally symmetric
Rules
- This is code golf, so the smallest number of bytes wins.
- Standard loopholes are obviously not allowed.
- Assume that the week starts with Monday (thanks to Angs and Arnauld for suggestion).
- Consider only years between 1900 and 2100 (inclusive).
- The input and output formatting rules are permissive, meaning you can use any equivalent format that is native to the language of your choice.
- Base your solution on the Gregorian calendar.
7
Consider that dates are weird, you may want to specify exactly the rules, or limit the possible input to a small range (say, 1901-2099)
– user202729 – 2018-04-01T08:05:39.8832Things to avoid when writing challenges/Adding unnecessarily stuff includes "Making answers calculate
f(x)
for everyx
in a list." What about "take an input in form of a date"? – user202729 – 2018-04-01T08:08:04.3636
Welcome to PPCG, and nice first challenge! Although this challenge is good, in the future if you want some feedback on the challenge before posting, you can post it in the sandbox.
– user202729 – 2018-04-01T08:11:50.353@user202729 Fair points, I'll clarify that and change the input form, thanks! – mkierc – 2018-04-01T08:16:16.960
2Should the output be strictly the mentioned strings, or any 3 distinct values? – Uriel – 2018-04-01T09:03:57.963
1Could you add (links to) images for those on mobile, which stupidly doesn't use a monospaced font for code? – Shaggy – 2018-04-01T09:08:02.840
1@Uriel I've added details about the input/output format – mkierc – 2018-04-01T09:12:03.570
I believe it's your choice to make, however I'd just make a note that strict output is usually frowned upon on the site – Uriel – 2018-04-01T09:31:07.977
@Uriel I guess you're right, the length of program depends strongly on that, so I think I'll allow for permissive output as well. – mkierc – 2018-04-01T09:36:07.163
1Does between 1900 and 2100 include 1900 and 2100 ? (important for leap year reasons. I'd obviously prefer "no") – Ton Hospel – 2018-04-01T19:07:36.980
What timezone and country should the months be calculated for? Months are a weird concept – Ferrybig – 2018-04-02T11:17:49.183
@Ferrybig Gregorian calendar. AFAIK that's not affected by timezone/country. – user202729 – 2018-04-02T16:10:20.837
2(wait a minute, Gregorian calendar or Julian calendar? I suggested [1901-2099] but you decide to use [1900-2100] so they're different for some inputs) – user202729 – 2018-04-02T16:14:40.370
@mkierc May we use Sunday as first day of the week? – Adám – 2018-04-03T14:36:59.143