They aren't. Want proof? Try writing an algorithm that will tell you when easter occurs for a given year.
EDIT: I hadn't expected people to jump up to the challenge, but the amount of people starting their solutions with "Given ____..." kind of hints at how non-straightforward it is.
Give me access to pre-made: -What weekday is given date -What moonphase is at given date -Some ok Date data structure, and it would be something like:
Date day = firstSpringDay; //firstSpringDay would be constant in code, don't remember that day today
day.year = calculatedYear;
bool wasFullMoon = false;
while(1){
if(GetMoonPhase(day) == MoonPhases::Full){
wasFullMoon = true;
}
//not sure if sunday in fullmoon counts, if not it would be elseif here
if(wasFullMoon && GetWeekDay(day) == WeekDay::Sunday){
return day;
}
day.day++;
}
31
u/Muhznit May 16 '20 edited May 16 '20
They aren't. Want proof? Try writing an algorithm that will tell you when easter occurs for a given year.
EDIT: I hadn't expected people to jump up to the challenge, but the amount of people starting their solutions with "Given ____..." kind of hints at how non-straightforward it is.