Day of the week: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added MiniScript) |
||
Line 3,602: | Line 3,602: | ||
lambda([y], weekday(y, 12, 25) = 'sunday)); |
lambda([y], weekday(y, 12, 25) = 'sunday)); |
||
/* [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118] */</syntaxhighlight> |
/* [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118] */</syntaxhighlight> |
||
=={{header|MiniScript}}== |
|||
<syntaxhighlight lang="miniscript">import "dateTime" |
|||
print "Years between 2008 and 2121 when 25th December falls on Sunday:" |
|||
years = [] |
|||
for year in range(2008, 2121) |
|||
date = year + "-12-25" |
|||
if dateTime.weekday(date) == 0 then years.push year |
|||
end for |
|||
print years.join(", ")</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Years between 2008 and 2121 when 25th December falls on Sunday: |
|||
2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118 |
|||
</pre> |
|||
=={{header|МК-61/52}}== |
=={{header|МК-61/52}}== |