Jump to content

Chinese zodiac: Difference between revisions

m
m (→‎JavaScript ES6: Tidied, updated output.)
Line 2,263:
];
};
 
 
// ---------------------- TEST -----------------------
Line 2,280 ⟶ 2,281:
[6, 11, 8, 8, 4]
];
 
 
// showYear :: Int -> String
Line 2,286 ⟶ 2,288:
.map(
row => row.map(
([n, s]) => justifyLefts.padEnd(n)(, " ")(s)
)
.join("")
Line 2,297 ⟶ 2,299:
// chars :: String -> [Char]
const chars = s => [...s];
 
 
// justifyLeft :: Int -> Char -> String -> String
const justifyLeft = n =>
// The string s, followed by enough padding (with
// the character c) to reach the string length n.
c => s => n > s.length ? (
s.padEnd(n, c)
) : s;
 
 
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.