You can solve fizzbuzz, right?
fizzbuzz isn't a problem that you solve. it's an exercise.
>>56989879
>solve
>fizzbuzz
god this board drops IQ by the day
>>56989879
It's a simple oversight problem for experienced developers
Note: don't ever have the string "fizzbuzz" print to the console in one line. It's a waste of a line.
>>56989879
>You can solve fizzbuzz, right?
Yes.
>>56989879
Why does 27, 28 and 37 days buzz in that picture?
fun helper (i, lst) =
if (i < 100)
then case (i mod 3 = 0, i mod 5 = 0) of
(true, false) => helper(i+1, lst@["Fizz"])
| (false, true) => helper(i+1, lst@["Buzz"])
| (true, true) => helper(i+1, lst@["FizzBuzz"])
| (false, false) => helper(i+1, lst@[Int.toString i])
else lst
fun fizzbuzz () = helper(1,[])
val x = fizzbuzz()
getElem :: Int -> String
getElem n = let fizz = if mod n 3 == 0 then "fizz" else []
buzz = if mod n 5 == 0 then "buzz" else []
in if null fizz && null buzz
then show n
else fizz ++ buzz
main = mapM_ (putStrLn . getElem) [1 .. 100]