Created
February 5, 2010 03:19
-
-
Save yuroyoro/295462 to your computer and use it in GitHub Desktop.
This file contains 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
// http://ja.wikipedia.org/wiki/恵方#.E6.81.B5.E6.96.B9 | |
object 恵方{ | |
import java.util.{Date,Calendar} | |
def 今年の恵方 = この年の恵方は_?( Calendar.getInstance ) | |
def この年の恵方は_? ( 年:Calendar ):恵方 = 年.get( Calendar.YEAR ) % 5 match { | |
case 0 => 恵方("庚の方","申と酉の中間","255°","西微南やや左","西南西やや右") | |
case 1 => 恵方("丙の方","巳と午の中間","165°","南微東やや左","南南東やや右") | |
case 2 => 恵方("壬の方","亥と子の中間","345°","北微西やや左","北北西やや右") | |
case 3 => 恵方("丙の方","巳と午の中間","165°","南微東やや左","南南東やや右") | |
case 4 => 恵方("甲の方","寅と卯の中間","75°","東微北やや左","東北東やや右") | |
} | |
def この年の恵方は_? ( 年:Date ):恵方 = { | |
val カレンダー = Calendar.getInstance | |
カレンダー.setTime( 年 ) | |
この年の恵方は_? ( カレンダー ) | |
} | |
case class 恵方(正確に:String, 十二支:String, 方位角:String, 方位32:String, 方位16:String ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment