Orthodox Easter calculator I have code for calculating the date for orthodox Easter and it makes me cry when I look at the if-else part. Please give your suggestions on how to make it shine (if possible).

I guess I can format day/month to DateTime format but I'm afraid it'll bring just more mess.

It works just fine though this.

Source

puts "- Hello, I'm EasterEvaluator. I can tell you when will be(or was) Easter."
puts "- Please enter the year which you'r interested in:"
year = gets.chomp.to_i
a = year % 19
b = year % 4
c = year % 7
d = (19*a+15) % 30
e = (2*b + 4*c + 6*d + 6) % 7
f = d + e
if f&lt;=9 
    easter = 22+f
    easter = easter + 13 if year &gt; 1918
    if easter &gt; 31
        easter = easter - 31
        month = "April"
    else
        month = "March"
    end
else
    easter = f-9
    easter = easter + 13 if year &gt; 1918
    if easter &gt; 30
        easter = easter-30 
        month = "May"
    else 
        month = "April"
    end
end

puts "- In #{year}, Easter is going to be on #{easter} of #{month}."
Completely untested psuedo-code, but the key is to realize f = number of days from March 22 to Orthodox Easter.

(* f gives Easter as the number of days since March 22 *) 

easter = f+22+(year&lt;1918)*13 

month = "March"; # default 
if f &gt; 31 {month="April"; day=f-31} 
if f &gt; 61 {month="May"; day=f-61} 


You might also post to http://codegolf.stackexchange.com