completeMatrix => pad

master
Karchnu 2016-01-23 01:36:46 +01:00
parent 499fa18707
commit df467a8133
1 changed files with 2 additions and 2 deletions

View File

@ -1,3 +1,3 @@
import Data.List
main = do interact $ (unlines . map unwords . transpose . map (completeMatrix ' ') . transpose . completeMatrix "" . map words . lines)
where completeMatrix v m = map (\e -> e ++ replicate ((maximum $ map length m)- length e) v) m
main = do interact $ (unlines . map unwords . transpose . map (pad ' ') . transpose . pad "" . map words . lines)
where pad v m = map (\e -> e ++ replicate ((maximum $ map length m)- length e) v) m