Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
for (var year = 2008; year <= 2121; year++){
var xmas = new Date(year, 11, 25)
if ( xmas.getDay() === 0 )
console.log(year)
}

View file

@ -0,0 +1,21 @@
(function () {
'use strict';
// isXmasSunday :: Integer -> Bool
function isXmasSunday(year) {
return (new Date(year, 11, 25))
.getDay() === 0;
}
// range :: Int -> Int -> [Int]
function range(m, n) {
return Array.apply(null, Array(n - m + 1))
.map(function (_, i) {
return m + i;
});
}
return range(2008, 2121)
.filter(isXmasSunday);
})();

View file

@ -0,0 +1,31 @@
(() => {
"use strict";
// main :: IO ()
const main = () => {
const
xs = enumFromTo(2008)(2121)
.filter(xmasIsSunday);
return (
console.log(xs),
xs
);
};
// xmasIsSunday :: Int -> Bool
const xmasIsSunday = year =>
(new Date(year, 11, 25))
.getDay() === 0;
// enumFromTo :: Int -> Int -> [Int]
const enumFromTo = m =>
n => Array.from({
length: 1 + n - m
}, (_, i) => m + i);
// MAIN ---
return main();
})();

View file

@ -0,0 +1 @@
[2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]