Repeat a string: Difference between revisions
→{{header|Haskell}}
(→{{header|Haskell}}: For higher numbers of repetitions, Rhind Papyrus 'Egyptian' or 'Ethiopian' multiplication may be more efficient.) |
|||
Line 818:
import Control.Monad (join)
-- BY RHIND PAPYRUS 'EGYPTIAN' OR 'ETHIOPIAN' MULTIPLICATION
repString :: Int -> String -> String
repString n m =
Line 826:
then mappend a x
else a)
zip
(unfoldr
Line 838:
-- TEST -----------------------------------------------------------------------
main :: IO ()
main = print $ repString
=={{header|HicEst}}==
|