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">
proc dayOfTheWeek year month day . result .
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
result = (januaryOne + NthDay - 1) mod 7
return (januaryOne + NthDay - 1) mod 7
.
.
for i = 2008 to 2121
for i = 2008 to 2121
call dayOfTheWeek i 12 25 result
if dayOfTheWeek i 12 25 = 0
if result = 0
print "Christmas in " & i & " is on Sunday"
print "Christmas in " & i & " is on Sunday"
.
.