I'm less than 4 years from the end of my current employment, and need to decide what to do next. Helping prop up aging COBOL is on my list to consider. :)
To bring it into this century, here's an F# version...
let words = function | _ when 0 = nbr % 3 && 0 = nbr % 5 -> "FizzBuzz" | _ when 0 = nbr % 3 -> "Fizz" | _ when 0 = nbr % 5 -> "Buzz" | x -> string x let fizzBuzz i = [1 .. i] |> List.map words |> String.concat ", " fizzBuzz 100 |> System.Console.WriteLine
...although, technically, this separates them by commas rather than listing one per line.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm less than 4 years from the end of my current employment, and need to decide what to do next. Helping prop up aging COBOL is on my list to consider. :)
To bring it into this century, here's an F# version...
...although, technically, this separates them by commas rather than listing one per line.