Today, I wanted to play around with something a bit different – figuring out someone’s Chinese zodiac sign based on their birth year. I’ve always been kind of curious about the zodiac, so I thought, “Why not try to code this?”
First, I grabbed a piece of paper and a pen. Old school, I know! I needed to get the basics down. I remembered that the zodiac cycle repeats every 12 years, and each year is represented by an animal.
My Little Experiment Begins
I started by listing out the 12 animals: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, and Pig. Then, I needed a reference point. I knew someone born in 1990 was a Horse, so I used that as my starting year.

Next, I scribbled down a simple calculation. I figured I could take the birth year, subtract 1990, and then find the remainder after dividing by 12. That remainder should correspond to the animal’s position in my list (with Horse being position 0, for this specific calculation).
I tested it out with a few birth years:
- My own birth year! It worked!
- My friend’s birth year…Success!
- My mom’s birth year. Bingo!
After a few test using paper and pen, I jumped into coding. Since no code is required, I did not use any programming language. But all in all, it was super easy to implement!
It’s not the most complex project, but it was a fun little exercise. And hey, now I can quickly tell you your Chinese zodiac sign! It’s these little projects that keep things interesting, right?