General FizzBuzz: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: Tidied.) |
|||
Line 1,408: | Line 1,408: | ||
----------------- FIZZETC (USING RULE SET) --------------- |
----------------- FIZZETC (USING RULE SET) --------------- |
||
fizzEtc :: [ |
fizzEtc :: [(Int, String)] -> [String] |
||
fizzEtc rules |
fizzEtc rules = foldr nextLine [] [1 ..] |
||
where |
where |
||
nextLine x a |
nextLine x a |
||
Line 1,422: | Line 1,422: | ||
------------------- TEST OF SAMPLE RULES ----------------- |
------------------- TEST OF SAMPLE RULES ----------------- |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
main :: IO () |
main :: IO () |
||
main = mapM_ putStrLn |
main = mapM_ putStrLn $ take 20 fizzTest |
||
</lang> |
|||
{{Out}} |
{{Out}} |
||
<pre>1 |
<pre>1 |