Skip to content

Instantly share code, notes, and snippets.

@Qata
Created March 29, 2016 22:54
Show Gist options
  • Save Qata/3ed757450f0cc01e039df5df941f3cdb to your computer and use it in GitHub Desktop.
Save Qata/3ed757450f0cc01e039df5df941f3cdb to your computer and use it in GitHub Desktop.
import Graphics.Element exposing (Element, leftAligned, flow, down)
import List exposing (map, intersperse)
import Text exposing (fromString)
fizzBuzz : Int -> String
fizzBuzz n =
case (n % 3, n % 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
_ -> toString n
main : Element
main =
map fizzBuzz [1..100]
|> map (fromString >> leftAligned)
|> flow down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment