Rep-string: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: Tidied alternative version. Applied Ormolu.) |
|||
Line 1,397: | Line 1,397: | ||
repCycles :: String -> [String] |
repCycles :: String -> [String] |
||
repCycles cs = |
repCycles cs = |
||
⚫ | |||
⚫ | |||
((cs ==) . take n . cycle) |
|||
⚫ | |||
((tail . inits) $ take (quot n 2) cs) |
|||
where |
|||
(tail $ inits (take (quot n 2) cs)) |
|||
⚫ | |||
--------------------------- TEST ------------------------- |
--------------------------- TEST ------------------------- |