LoginSignup
19
18

More than 5 years have passed since last update.

恵方巻きの方角を取得する

Last updated at Posted at 2015-01-08

恵方巻きの方角は西暦の下一桁で決まるそうです。

西暦下一桁 恵方
4, 9 東北東微東
5, 0 西南西微西
6, 1 南南東微南
7, 2 北北西微北
8, 3 南南東微南

規則的!
ってことでjsで書いた。


var getRolledThicklyDirection = function(year) {
    var directions = [
        "西南西微西",
        "南南東微南",
        "北北西微北",
        "南南東微南",
        "東北東微東"
    ];
    return directions[year % 5];
};

ちなみに2015年は「西南西微西」です。

19
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
18