diff --git a/haskell/columnv5.hs b/haskell/columnv5.hs new file mode 100644 index 0000000..0cf9a64 --- /dev/null +++ b/haskell/columnv5.hs @@ -0,0 +1,7 @@ +import Data.List as L + +main = do + content <- getContents + putStr $ unlines $ map unwords $ L.transpose $ map formatLine $ L.transpose $ completeMatrix $ map words $ lines content + where completeMatrix m = map (\e -> e ++ [""| _ <- [length e .. (\ x -> maximum $ map length x) m ]]) m + formatLine x = map (\e -> e ++ [' ' | _ <- [length e..(\ x -> maximum $ map length x) x]]) x