Last active
August 29, 2015 14:06
-
-
Save ethertank/0226746bb4f66705a21e to your computer and use it in GitHub Desktop.
十干十二支
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
zikkan /*十干(天干)*/, | |
eto /*十二支(地支)*/, | |
kanshi /*干支*/; | |
zikkan = "甲乙丙丁戊己庚辛壬癸".split(""); | |
eto = "子丑寅卯辰巳午未申酉戌亥".split(""); | |
kanshi = (function(res) { | |
//http://ja.wikipedia.org/wiki/%E5%B9%B2%E6%94%AF | |
for (var i = 0; i < 60; i++) { | |
res.push( zikkan[i%10] + eto[i%12] ); | |
} | |
return res; | |
})([]); | |
/* 10line*6col */ /* | |
for(var i = 0; i < 10; i++) { | |
var line = document.createElement("div"); | |
var txt = document.createTextNode( | |
kanshi.splice(0, 6).join(" ") | |
); | |
line.appendChild(txt); | |
document.body.appendChild(line); | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment