Multiplication tables: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed some comments and whitespace.)
Line 2,257: Line 2,257:
table n = concat <$> xs
table n = concat <$> xs
where
where
xs = concatMap (\x -> [[fmt x] ++ [drop 2 pad] ++
xs = map (\x -> fmt x : drop 2 pad :
concatMap (\y -> if y < x then [pad]
map (\y -> if y < x then pad
else [fmt $ x * y])
else (fmt $ x * y))
range])
range)
range
range
where
where
fmt e = drop (length s) (pad ++ s)
fmt e = drop (length s) (pad ++ s)