Doomsday rule: Difference between revisions

m
→‎{{header|REXX}}: simplified some code.
(added Perl programming solution)
m (→‎{{header|REXX}}: simplified some code.)
Line 895:
y.1= 4 1 7 4 2 6 4 1 5 3 7 5 /* " " " leapyear " */
 
do j=1 for words($); datum= word($, j) /*process each of the dates. */
parse valuevar word($,datum j) with mm '/' dd "/" yy /*parse the date ──► mm dd yy */
ly= leapyear(yy) /*get indication of a leapyear. */
wd= (doomsday(yy)+dd-word(y.ly, mm) + 7) // 7 + 1 /*obtain a code for the weekday. */
say mm'/'dd"/"yydatum ' falls on ' word(d, wd)"day" /*display day-of-week for date. */
end /*j*/
exit 0 /*stick a fork in it, we're all done. */