So I'm in need of a little assistance or at least a point in the right direction! I'm new to Haskell but I'm familiar with C# and PHP.
I'm trying to create a FizzBuzz function that allows 3 parameters to be entered. I understand the general concept of FizzBuzz but I'm trying to be able to create a function that allows you to put the first divisor, second divisor and the last parameter as an upper range. The part where I'm struggling to understand is how you assign input values to variables in a function.
I found different tutorials showing how to do the regular FizzBuzz in Haskell.
So my main questions would be this:
How do you assign input values to variables? I know how to assign the type, which would be something like this but I don't know how you would reference it in a function.
fz' :: [Integer, Integer, Integer] -> Integer -> Integer -> Integer
From what I've read online, it's better to separate the functions instead of having one large function to perform everything. With that being said, would it be best to have:
a. One function receive the input values and assign them variables, then call separate functions?
b. In the separate functions, set the range and then do
divideBy
ormod
to check if valuex
is divisible by[1..z]
print fizz, ifx
andy
are divisble by[1..z]
print fizzbuzz, ify
is divisible by[1..z]
print buzz? Is it better to use awhere
clause orcase
?c. Separate function that implements the values for the range and
(x,y,z)
?..
Any ideas, tips, help?