Day of the week: Difference between revisions
Content added Content deleted
No edit summary |
(added arc lisp) |
||
Line 320: | Line 320: | ||
<lang AppleScript>{2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, |
<lang AppleScript>{2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, |
||
2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118}</lang> |
2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118}</lang> |
||
=={{header|Arc}}== |
|||
<lang arc> |
|||
(= day-names '(Sunday Monday Tuesday Wednesday Thursday Friday Saturday)) |
|||
(= get-weekday-num (fn (year month day) |
|||
(= helper '(0 3 2 5 0 3 5 1 4 6 2 4)) |
|||
(if (< month 3) (= year (- year 1))) |
|||
(mod (+ year (helper (- month 1)) day |
|||
(apply + (map [trunc (/ year _)] '(4 -100 400)))) |
|||
7))) |
|||
(= get-weekday-name (fn (weekday-num) (day-names weekday-num))) |
|||
</lang> |
|||
<b>test:</b> |
|||
<lang arc>(up i 2008 2121 |
|||
(when (is 0 (get-weekday-num i 12 25)) |
|||
(prn i))) |
|||
2011 |
|||
2016 |
|||
... |
|||
</lang> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |