- Task:
With the minimum amount of bytes, determine today's Zodiac sign using the programming language of your choice. - Rules:
This is code golf, the answer with the fewest characters wins. The initialization of getting the current date into a variable (e.g.var now = new Date();
) does not add to the count. Leap years must be handled correctly. - Limitations:
You cannot use any other library functions for handling dates, nor predefined lists. In particular, participants would have to calculate the ordinal day of the year themselves if needed. - Input:
The current date in the proleptic Gregorian calendar with numeric year, month (1–12) and day of the month (1–28…31). - Output:
A single Unicode symbol indicating the current one of the twelve Zodiac signs from Western astrology, as used in horoscopes and listed below:
- ♈︎ Aries: March 21 – April 19
- ♉︎ Taurus: April 20 – May 20
- ♊︎ Gemini: May 21 – June 21
- ♋︎ Cancer: June 22 – July 22
- ♌︎ Leo: July 23 – August 22
- ♍︎ Virgo: August 23 – September 22
- ♎︎ Libra: September 23 – October 22
- ♏︎ Scorpio: October 23 – November 22
- ♐︎ Sagittarius: November 23 – December 21
- ♑︎ Capricorn: December 22 – January 19
- ♒︎ Aquarius: January 20 – February 18
- ♓︎ Pisces: February 19 – March 20
The actual dates might differ by one day depending on the year, but for this task the above date ranges are considered accurate for every year.
Example
The sign for today, 28 February 2022, is Pisces, so the correct output would be ♓︎
.
now
object or something like that an advantage, so if your language does not have something like that, you can still assume that there is a variable that has this information. You are right that this boils down to: you have a month number and a day number. \$\endgroup\$