Day of the week: Difference between revisions

no edit summary
No edit summary
Line 896:
2011 2016 2022 2033 2039 2044 2050 2061 2067 2072 2078 2089 2095 2101 2107 2112 2118
</lang>
 
=={{header|Lasso}}==
LASSO CODE
 
<?LassoScript
 
loop(-From=2008, -to=2121);
var('tDate' = date('12/25/' + loop_count));
$tDate -> dayOfWeek == 1 ? '<br />' + $tDate -> format('%D') + ' is a Sunday';
/loop;
 
?>
 
Output:
 
<pre>
12/25/2011 is a Sunday
12/25/2016 is a Sunday
12/25/2022 is a Sunday
12/25/2033 is a Sunday
12/25/2039 is a Sunday
12/25/2044 is a Sunday
12/25/2050 is a Sunday
12/25/2061 is a Sunday
12/25/2067 is a Sunday
12/25/2072 is a Sunday
12/25/2078 is a Sunday
12/25/2089 is a Sunday
12/25/2095 is a Sunday
12/25/2101 is a Sunday
12/25/2107 is a Sunday
12/25/2112 is a Sunday
12/25/2118 is a Sunday
</pre>
 
=={{header|Liberty BASIC}}==
Line 1,062 ⟶ 1,096:
</pre>
 
=={{header|МК??-61/52}}==
<lang>П9?9 7 П7?7 1 П8?8 НОП??? ИП8??8 2 2 -
1 0 / [x] П6?6 ИП9??9 + 1 8 9
9 - 3 6 5 , 2 5 * [x]
ИП8??8 ИП6??6 1 2 * - 1 4 - 3
0 , 5 9 * [x] + 2 9 +
ИП7??7 + П4?4 ИП4??4 7 / [x] 7 * -
x=0 64 ИП9??9 С?/П? ИП9??9 1 + П9?9 БП?? 06</lang>
 
''Input:'' РX?X: starting year.
 
''Output:'' the year in which Christmas falls on a Sunday. For example, enter ''2008'', the first result: ''2018'' (''January 7, 2018'' is Sunday).
Line 1,878 ⟶ 1,912:
end /*y*/
exit /*stick a fork in it, we're done.*/
/*-------------------------------------DOW (day of week) subroutine-----*/
/*─────────────────────────────────────DOW (day of week) subroutine─────*/
dow: procedure; arg m,d,y; if m<3 then do; m=m+12; y=y-1; end
yL=left(y,2); yr=right(y,2); w=(d + (m+1)*26%10+yr+yr%4+yL%4+5*yL) // 7
Anonymous user