General FizzBuzz: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) (→{{header|R}}: Changed variable name, refactored if statement, and added new solution.) |
(→{{header|Haskell}}: Tidied.) |
||
Line 1,406:
<lang haskell>type Rule = (Int, String)
----------------- FIZZETC (USING RULE SET) ---------------
testFizz :: Int -> [String]▼
testFizz = fizz [(3, "Fizz"), (5, "Buzz"), (7, "Baxx")]▼
where
nextLine x a
| otherwise =
where
noise = foldl reWrite [] rules
reWrite s (m, k)
| 0 == rem x m = s
------------------- TEST OF SAMPLE RULES -----------------
▲testFizz :: Int -> [String]
main :: IO ()
|