Multiplication tables: Difference between revisions
Added Haskell.
(→Tcl: Added implementation) |
Underscore (talk | contribs) (Added Haskell.) |
||
Line 5:
=={{header|ALGOL 68}}==
<lang
INT max = 12;
STRING empty cell = " ";
Line 39:
</pre>
=={{header|Haskell}}==
<lang haskell>import Text.Printf
main = do
putStrLn $ " x" ++ concatMap fmt [1..12]
mapM_ putStrLn $ zipWith f [1..12] $ iterate (" " ++) ""
where f n s = fmt n ++ s ++ concatMap (fmt . (*n)) [n..12]
fmt n = printf "%4d" (n :: Int)</lang>
=={{header|Tcl}}==
|