• + 2 comments

    UPDATE: Finally, figured out how to print a [[Char]] in the correct format with Haskell...

    -- PRINT with FORMAT    
    two :: [Int] -> [String]
    two m = map (show) m
    
    three :: [[Int]] -> [[String]]
    three m = map (two) m
    
    main = do   
       m <- readLn :: IO Int
       --send (tri m) -- print tri to row m
       mapM_ (putStrLn . intercalate " " $) (three (tri m))
    

    Where (tri m) produces [["1"], ["1", "1"], ["1", "2", "1"], ["1", "3", "3", "1"]]