Computus in scala and java
In the spirit of the holiday, I figured I would try my hand at writing computus in scala and java. For those who aren't aware, computus is the algorithm used to compute which day easter falls on. First, the scala version: object Computus { def main(args: Array[String]) { val start = System.currentTimeMillis() for (year <- 2000.until(1000000)) { println(pretty_computus(year)) } println(System.currentTimeMillis()-start) } def golden(year:Long):Long = { year % 19 + 1 } def century(year:Long):Long = { (year / 100) +1 } def solar(year:Long):Long = { (3 * (century(year) /4) ) -12 } def lunar(year:Long):Long = { ((8 * century(year) +5) / 25) - 5 } def letter(year:Long):Long = { 5 * year / 4 - solar(year) - 10 } def epact(year:Long):Long = { (11 * golden(year) + 20 +lunar(year) - solar(year)) %30 } def correct_9006(year:Long):Long = { val epact_val = epact(year) if (epact_val < 0)