Base-16 representation: Difference between revisions
m
→{{header|Haskell}}
(→{{header|JavaScript}}: Added a JavaScript version.) |
|||
Line 875:
<> show upperLimit
<> ":\n",
table justifyRight " " $ chunksOf 15 xs
]
------------------------- DISPLAY ------------------------
table ::
(Int -> Char -> String -> String) ->
table gap rows =▼
String ->
let ws = maximum . fmap length <$> transpose rows▼
[[String]] ->
String
▲table alignment gap rows =
unlines $
fmap
( intercalate gap
. zipWith (`alignment` ' ') colWidths
)
rows
where
justifyRight :: Int -> Char -> String -> String
justifyRight n c = (drop . length) <*> (replicate n c <>)</lang>
{{Out}}
<pre>301 matches up to 500:
|