September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -5,7 +5,7 @@
const roman = n =>
concat(snd(mapAccumL((balance, [k, v]) => {
const [q, r] = quotRem(balance, v);
return [r, q > 0 ? concat(replicate(q, k)) : ''];
return [r, q > 0 ? k.repeat(q) : ''];
}, n, [
['M', 1000],
['CM', 900],
@ -49,12 +49,6 @@
// quotRem :: Integral a => a -> a -> (a, a)
const quotRem = (m, n) => [Math.floor(m / n), m % n];
// replicate :: Int -> a -> [a]
const replicate = (n, x) =>
Array.from({
length: n
}, () => x);
// show :: a -> String
const show = (...x) =>
JSON.stringify.apply(