Day of the week: Difference between revisions
Content added Content deleted
Line 2,125: | Line 2,125: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<syntaxhighlight lang="easylang"> |
<syntaxhighlight lang="easylang"> |
||
func dayOfTheWeek year month day . |
|||
# Based on Conway's doomsday algorithm |
# Based on Conway's doomsday algorithm |
||
# 1. Calculate the doomsday for the century |
# 1. Calculate the doomsday for the century |
||
Line 2,189: | Line 2,189: | ||
NthDay += day |
NthDay += day |
||
# 6. Finally, calculate the day of the week |
# 6. Finally, calculate the day of the week |
||
return (januaryOne + NthDay - 1) mod 7 |
|||
. |
. |
||
for i = 2008 to 2121 |
for i = 2008 to 2121 |
||
if dayOfTheWeek i 12 25 = 0 |
|||
if result = 0 |
|||
print "Christmas in " & i & " is on Sunday" |
print "Christmas in " & i & " is on Sunday" |
||
. |
. |