| Bytes | Lang | Time | Link |
|---|---|---|---|
| nan | Embark on this celestial journey with me | 240702T102353Z | Sonali V |
| 062 | JavaScript Node.js | 220228T152729Z | Arnauld |
| 031 | Charcoal | 220301T095211Z | Neil |
| 112 | Retina 0.8.2 | 220301T010233Z | Neil |
| 027 | Jelly | 220228T184917Z | Jonathan |
Embark on this celestial journey with me, my dears. Let the stars be your guide as you navigate the coming year with cosmic confidence and a touch of astrological magic.
JavaScript (Node.js), 64 62 bytes
Expects (month)(day).
This version builds the UTF-8 encoding of the code point (from 0xE2 0x99 0x88 for Aries to 0xE2 0x99 0x93 for Pisces).
m=>d=>Buffer([226,153,136+(m+=9^d<24+~"1342321"[m%12])%12])+''
ES6, 63 bytes
Using the more straightforward String.fromCharCode() with a direct code point is one byte longer.
m=>d=>String.fromCharCode(9800+(m+=9^d<24+~"1342321"[m%12])%12)
Charcoal, 31 bytes
Nθ℅⁺⁹⁸⁰⁰﹪⁺⁸⁺θ›N⁺¹⁸I§”)⊞⌊4\`ζ”θ¹²
Try it online! Link is to verbose version of code. Takes separate month and day as inputs. Explanation:
Nθ First input as a number
N Second input as a number
› Is greater than
”...” Compressed string `310212344444`
§ Cyclically indexed by
θ Input month
I Cast to integer
⁺ Plus
¹⁸ Literal integer `18`
⁺ Plus
θ Input month
⁺ Plus
⁸ Literal integer `8`
﹪ Modulo
¹² Literal integer `12`
⁺ Plus
⁹⁸⁰⁰ Literal integer `9800`
℅ Convert to Unicode
Implicitly print
Retina 0.8.2, 112 bytes
T`d`k-m`1.-
T`d`l`.-
T`b-m`c-mb`.-3|[bce]-2|[df]-2[1-9]|[gm]-2[2-9]|[h-l]-2[3-9]|c-19
.(.).+
$1
T`e-mb-d`♈-♓
Try it online! Link includes test cases. Takes input in the format mm-dd. Does not output a Unicode variation selector, but the output looks fine in TIO to me. Explanation:
T`d`k-m`1.-
Change October to December to k to m, which will become Scorpio to Capricorn.
T`d`l`.-
Change January to September to b to j, which will become Aquarius to Libra.
T`b-m`c-mb`.-3|[bce]-2|[df]-2[1-9]|[gm]-2[2-9]|[h-l]-2[3-9]|c-19
Increment the encoded sign if the day is past the cutoff date for the next sign.
.(.).+
$1
Delete everything except the encoded sign.
T`e-mb-d`♈-♓
Decode to a Unicode Zodiac sign.
Jelly, 27 bytes
“£f{ẋ’b5⁸ị+19>_@⁸_3%12+⁽#1Ọ
A dyadic Link accepting an integer, month, on the left and an integer, day, on the right that yields a character.
Try it online! Or see a whole year.
How?
“£f{ẋ’b5⁸ị+19>_@⁸_3%12+⁽#1Ọ - Link: M; D
“£f{ẋ’ - 53343748
b5 - to base five -> [1, 0, 2, 1, 2, 3, 4, 4, 4, 4, 4, 3]
⁸ị - get the item at 1-indexed index M
+19 - add nineteen to it
> - is that greater than D? -> 1 or 0
_@⁸ - subtract from M -> M-1 or M
_3 - subtract three (offset since characters start at March)
%12 - modulo twelve
⁽#1 - 9800
+ - add
Ọ - cast to character