Multiplication tables: Difference between revisions
m
→{{header|Haskell}}
(→{{header|Haskell}}: or, a Prelude - only version) |
|||
Line 2,256:
table n = concat <$> xs
where
xs = concatMap (\x -> [[fmt x] ++ [
concatMap (\y -> if y < x then [
else [fmt $ x * y])
range])
range
where
fmt e = drop (length s) (
where
s = show e
pad = " "
range = [1..n]
|