passage à columnv4 => moins lisible, mais seulement 9 lignes
This commit is contained in:
		
							parent
							
								
									3e4f7aa8be
								
							
						
					
					
						commit
						d05cd6494c
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								haskell/columnv4.hs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								haskell/columnv4.hs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,9 @@
 | 
				
			||||||
 | 
					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..nb]]) m
 | 
				
			||||||
 | 
					                             where nb = maximum $ map length m
 | 
				
			||||||
 | 
					          formatLine x = map (\e -> e ++ [' ' | _ <- [length e..nb]]) x
 | 
				
			||||||
 | 
					                         where nb = maximum $ map length x
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue