Anonymous user
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|
<lang>
1 0 / [x]
9 - 3 6 5 , 2 5 * [x]
0 , 5 9 * [x] + 2 9 +
x=0 64
''Input:''
''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: 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
|