Retired

Prepare for the Easter! (retired)

22 of 37ozim

Description:

Ho!ho!ho! Christmas time is over, now we gotta wait for Easter to get some rest again! but wait... when is it? It's not so easy to remember all the Easter dates. Let's calculate that!

In this Kata your mission is to write a boolean method called 'easter?' (JS: 'isEaster()') which works only with Date class instances. For example:

Date.new(2014,12,12).easter?
new Date(2014,11,12).isEaster()

should return false, while

Date.new(2014,4,20)
new Date(2014,3,20).isEaster()

is definitely true!

To make everything clear and easy here we have some facts about this Kata:

  • we're using Gregorian Calendar and talking about Western Easter dates

  • as our method is a boolean method on Date class instances, we expect not to pass any other objects to our method (including nil and e.g. MyBrandNewBike class)

  • we're not interested in the middle ages and the far away future so we're only checking the Easter dates in for 1985-2045 years.

  • we know that the Easter Monday is usually a day to chill out as well and it's a part of Easter, but if you know the Easter Sunday date you also know the next day is Easter Monday - it's too obvious, we're looking only for the Easter Sunday here! That's the only way our method returns true.

Mathematics
Algorithms
Date Time
Fundamentals

More By Author:

Check out these other kata created by ozim

Stats:

CreatedDec 26, 2014
Warriors Trained194
Total Skips105
Total Code Submissions184
Total Times Completed37
Ruby Completions22
JavaScript Completions18
Total Stars3
% of votes with a positive feedback rating59% of 11
Total "Very Satisfied" Votes4
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes2
Total Rank Assessments14
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • ozim Avatar
  • jhoffner Avatar
  • ZozoFouchtra Avatar
Ad