columnv5 en 7 lignes => FUCK LA LISIBILITÉ
This commit is contained in:
		
							parent
							
								
									d05cd6494c
								
							
						
					
					
						commit
						06beadfdc9
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		
							
								
								
									
										7
									
								
								haskell/columnv5.hs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								haskell/columnv5.hs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue