Day of the week: Difference between revisions

Content added Content deleted
Line 1,502: Line 1,502:
print count; " years when Christmas Day falls on a Sunday"
print count; " years when Christmas Day falls on a Sunday"
end</lang>
end</lang>


=={{header|LiveCode}}==
<lang LiveCode>function xmasSunday startDate endDate
convert the long date to dateitems
put it into xmasDay
put 12 into item 2 of xmasDay
put 25 into item 3 of xmasDay
repeat with i = startDate to endDate
put i into item 1 of xmasDay
convert xmasDay to dateItems
if item 7 of xmasDay is 1 then put i & comma after xmasYear
end repeat
if the last char of xmasYear is comma then delete the last char of xmasYear
return xmasYear
end xmasSunday</lang>Example<lang LiveCode>put xmasSunday(2008,2121)</lang>Output<pre>2011,2016,2022,2033,2039,2044,2050,2061,2067,2072,2078,2089,2095,2101,2107,2112,2118</pre>


=={{header|Logo}}==
=={{header|Logo}}==