Day of the week: Difference between revisions
Content added Content deleted
(Added VTL-2) |
(→{{header|TypeScript}}: Added.) |
||
Line 4,861: | Line 4,861: | ||
2112 |
2112 |
||
2118 |
2118 |
||
</pre> |
|||
== {{header|TypeScript}} == |
|||
{{trans|Minimal BASIC}} |
|||
<lang javascript> |
|||
// Find years with Sunday Christmas |
|||
var f = 2008; |
|||
var t = 2121; |
|||
console.log(`Sunday Christmases ${f} - ${t}`); |
|||
for (y = f; y <= t; y++) { |
|||
var x = (y * 365) + Math.floor(y / 4) - Math.floor(y / 100) + Math.floor(y / 400) - 6; |
|||
if (x % 7 == 0) |
|||
process.stdout.write(`${y}\t`); |
|||
} |
|||
process.stdout.write("\n"); |
|||
</lang> |
|||
{{out}} |
|||
<pre> |
|||
Sunday Christmases 2008 - 2121 |
|||
2011 2016 2022 2033 2039 2044 2050 2061 2067 2072 2078 2089 2095 2101 2107 2112 2118 |
|||
</pre> |
</pre> |
||