-
-
Save cronin101/754cd999a5365b29aeed to your computer and use it in GitHub Desktop.
FishBuush is a monoid under the "shouting something" operator with a unit value of "no fishes".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Arrow | |
import Control.Monad | |
nToFishBuush :: (Show a, Integral a) => a -> String | |
nToFishBuush n = case ((`rem` 3) &&& (`rem` 5)) n of | |
(0, 0) -> "FISSSSSHBUSSSHH!" | |
(0, _) -> "fissshhhhhh" | |
(_, 0) -> "bUUUUUsh" | |
_ -> show n | |
doFishBuushUpto :: (Show a, Integral a) => a -> IO () | |
doFishBuushUpto = mapM_ (print . nToFishBuush) . (enumFromTo 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment