Jump to content

Last Friday of each month: Difference between revisions

Add entry for SenseTalk
(→‎{{Header|AppleScript}}: Moved later post to below previous one and added text.)
(Add entry for SenseTalk)
Line 3,606:
2013-11-29
2013-12-27
</pre>
 
=={{header|SenseTalk}}==
<lang sensetalk>
ask "What year?"
put it into year
 
put !"The last Fridays of each month in [[year]] are:"
 
set lastDayOfMonth to year & "-01-31" -- start with January 31 of the year
 
repeat 12 times
set lastFriday to lastDayOfMonth
repeat until weekdayName of lastFriday is "Friday"
subtract a day from lastFriday -- work back to Friday
end repeat
put the monthName of lastFriday && ordinalWords of the day of lastFriday
add a month to lastDayOfMonth -- advance to last day of next month
end repeat
</lang>
{{out}}
<pre>
The last Fridays of each month in 2008 are:
January twenty-fifth
February twenty-ninth
March twenty-eighth
April twenty-fifth
May thirtieth
June twenty-seventh
July twenty-fifth
August twenty-ninth
September twenty-sixth
October thirty-first
November twenty-eighth
December twenty-sixth
</pre>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.