Skip to main content
minus 1 byte from dropWhile
Source Link

Haskell, 151 bytes

z x|let y=last$(snd$break(`elem`"AEIOUaeiou")x):[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!

Haskell, 152 bytes

z x|let y=last$dropWhile(`notElem`"AEIOUaeiou")x:[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!

Haskell, 152 bytes

z x|let y=last$dropWhile(`notElem`"AEIOUaeiou")x:[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!

Haskell, 151 bytes

z x|let y=last$(snd$break(`elem`"AEIOUaeiou")x):[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!

Haskell, 152 bytes

z x|let y=last$dropWhile(`notElem`"AEIOUaeiou")x:[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!

Source Link

Haskell, 152 bytes

z x|let y=last$dropWhile(`notElem`"AEIOUaeiou")x:[tail x|elem(x!!0)"BFM"]=unlines[x++", "++x++", bo-b"++y,"Banana-fana fo-f"++y,"Fee-fi-mo-m"++y,x++"!"]

Try it online!