Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
One man went to mow
Documentation
song :: Int -> String Source #
song n は1人からn人まで登場する歌詞を表示する文字列を生成する
>>>
let shownl c = if c /= '\n' then [c] else "\\n\n"
>>>
let shownls = concatMap shownl
>>>
putStr $ shownls $ song 3
\n One man went to mow\n Went to mow a meadow\n One man add his dog\n Went to mow a meadow\n \n Two men went to mow\n Went to mow a meadow\n Two men, one man and his dog\n Went to mow a meadow\n \n Three men went to mow\n Went to mow a meadow\n Three men, two men, one man and his dog\n Went to mow a meadow\n